Friday, 6 December 2013

Object Oriented Programming

Although we take this development somewhat for granted today, conceptualizing object-orientation before it existed must have been like trying to visualize the fourth dimension.  This concept was entirely revolutionary in the writing of code as it gave us the ability to go beyond the simple commands involved in writing functions and variables, indeed we now have the power to surpass this level of code on a truly massive scale.

To see the beauty of this simplicity - we can examine even the language that we use! Python itself would be impossible if not for object orientation, and all the simplicities that Python brings with it would need to be hard-coded wherever they were used.  Simple things like integers, strings, floats, lists would all need to be defined explicitly in our code whenever we wanted to use them, before we could even start to run functions using them, or worse, if there did not even exist a framework for defining objects, we would need to merely impose the restrictions associated with various object types onto any input to our functions, or perhaps more lazily just allow them to fail if given improper inputs.

Object orientation has allowed us to bundle special properties and restrictions with private functions that will operate especially for the object in question, and with this we are able to write massive frameworks, and more importantly to import existing objects and constructs that we have previously written.  This is one of the easiest parts of Python, it has a huge number of predefined objects and simple tools for creating more that allow us to easily develop shortcuts and embrace the cardinal programming virtue of laziness, by simply writing implementations and then being able to reuse them in any instance where we require the same types of objects again, and that is a truly gargantuan advantage over implementing all of these myriad objects and properties on an individual procedural basis.

No comments:

Post a Comment