Wednesday, January 22, 2014

Week 3 - Object-Oriented Programming



I’ve heard the term ‘Object-oriented programming’ thrown about for some time now, but I’ve never taken the initiative to actually research the concept. Everyone I knew in high school who took that sort of initiative in computer science seemed to end up at Waterloo for some reason. Take that how you will. But now that I’ve given it some effort (albeit under considerable duress), I’m starting to see the broader layout of programming unfold before me.
Wikipedia tells me that object-oriented programming is one of five major “paradigms”, or fundamental methods of structuring computer program. Fun fact: The word ‘paradigm’ was languishing in obscurity until Thomas Kuhn resurrected it in his 1962 book The Structure of Scientific Revolutions. Since then it has been co-opted by a startling variety of other fields, with computer science obviously among their ranks.
But I digress. An object is an abstract data type that contains within it both data and behaviour. For instance, a class called Box could have a list of attributes corresponding to its contents, and some methods to add contents, steal contents, or anything you can imagine. It is the interaction of these objects that produce the function of the overall program. Encapsulating information in this way avoids “spaghetti code”, wherein “go to” statements that jump around within the program make the code unreadable. Furthermore, this compartmentalization ensures that changes to one object do not affect others.
 Some people who know a lot more about this than I do criticize OOP for trying to reduce language to classes. Steve Yegge likens it to putting too much emphasis on the nouns in English. Paul Graham says that OOP’s are popular because they prevent mediocre programmers from “doing too much damage”.  As a mediocre programmer I can’t help but feel slighted by that.  
Or so Wikipedia tells me. To be honest, I’m taking what I read in this article with a grain of salt. Although I have to give the author some credit for the use of some pretty florid language. I particularly liked the phrase “object-oriented technology often gets mired in the weeds”. I think the figurative language really highlights the symbolic nature of programming in general; things representing other things, right?
I’d like to take this opportunity to apologize for the generally sarcastic, tangential, and bombastic tone of this entry, and for any mental anguish caused to the reader. I think it stems from my deeper aversion to earnest self-expression, probably developed in early childhood. It’s not your fault. Thanks for reading.