Programming is like….

This year for Christmas, we got Luke a ‘choose your own adventure’ book.  When I was about his age, this sort of book was my favorite.  You read for a little bit, and then at the bottom of a page you get a few choices.  You make your choice and head to the page that it tells you based on the choice that you’ve made.  It’s like reading and playing a game all at the same time, it is what I would like to think as the precursor to online gaming.  Before there were these great graphical online games, there were muds mucks and moos, which were games, you just read them instead of seeing them.  Before that, there were basic games that you ran from the old ‘DOS prompt’ that were the same thing, just not ‘online.’  “You stand before a large door.  A large ornate knocker hangs from the front.  It looks like you can ‘knock’.  The obvious exits are: east, west.”  At the very beginning, it was simple logic programming, now it’s crazy amounts of code just to make the connection to the servers.

I was thinking about all of this as I was going over code written by one of the other programmers in the office.  Custom website programming in years past has always been very linear — X happens then Y happens — and you can follow the trail down the page like you would read a book.  In the last few years, Internet programming has gotten less linear and more ‘object oriented,’ which is more like the choose your own adventure books.  X happens and then we go to Y in another area, then Z in yet another depending on the next thing.  This programming methodology is based on the ‘newer’ programming languages like Java and C++, where everything is neatly tied up into little packages that are pretty much autonomous, getting, setting, and outputting all the essential things needed to make that little function go.  The problem I’m finding in this is that the code I’m reading is like reading those choose your own adventure books in reverse, you read a page and then find out how you got there.  It’s not easy.  I am not sure if it’s the coding style that I’m not used to or if there’s a logic problem that needs to be corrected but it’s a little frustrating.  I’m sure anyone who picks up my code feels similarly.

So, as I work on the medical IT project that someone else started, I am going to have to continue along the style that it is programmed, and hopefully it makes sense when and if the next programmer picks it up.