Wednesday, 22 January 2014

Object oriented programming

As a student, learning about programming, I thought to myself, how is object-oriented programming suppose to be different from what we programmed in CSC108?  The answer was not about the argument representing an object, it was about what we do with the argument and you know what, it did not make me smile that much.

To me, when we programmed in CSC108, we specified whether an argument is an integer, a float, a string, etc.  Now we just replace those arguments with a more general type, which is "object".  I like to think of how we use to program as if it was a library.  The shelves were methods and the books are the arguments where the shelf will want you to place a specific genre of books and not other genres.  Now it feels like we have boxes representing methods and we put objects (hmm, what a coincidence?) into that box.  The box does not prefer a specific object unlike the shelves which would prefer a certain genre of books.

Realistically, object-oriented programming is not different from how we use to program, all we have to do is add more code.

No comments:

Post a Comment