Saturday, February 14, 2015

Entry 4: Object-Oriented Programming Concepts

     I first encountered object-oriented programming back in high school. Specifically, in Grades 11 & 12, I learned Java and the basics of object-oriented programming. I was a little skeptical about the idea because I was unsure if there were any benefits (or drawbacks) to the idea. My first real encounter of programming was learning Visual Basic back in Grade 10. Essentially, learning that language was the reason I became interested in Computer Science because it was simple and straightforward. It took some time getting used to Java because the structure of developing a program was different compared to Visual Basic. So for the most part, I am familiar with the basic structure of object-oriented programming. 


A Cluster of OOP Languages


     OOP is composed of multiple objects, each containing its own set of data and functions. The advantage to this mode of programming is multiple objects can communicate to each other to perform a specific set of tasks. Visual Basic requires more effort because if an element requires changes, these changes must be made throughout the entire body of code. In my experience with Visual Basic, I created a program that simulates the card game "Black Jack" and it contained nearly 8000 lines of code. I say about 40% of the code was repetitive, which proves the efficiency of OOP. Another advantage to OOP over traditional programming is multiple instances of an object can be made by inheriting its definition. If I have multiple instances of an object and I wanted to modify a specific attribute, I can simply make the changes in its definition and these changes will apply to all the instances of that object. 

     As Professor Heap stated at the beginning of the semester, the most important virtue for first-year students is laziness and OOP perfectly fulfills this goal. 

No comments:

Post a Comment