Wednesday, January 22, 2014

Week 3: Object-Oriented Programming


So far the focus of CSC148 has been on object oriented programming (OOP) and recursion. I programmed in Java for 2 years in high school so I'm already familiar with the OOP concept as well as inheritance, but not with recursion. My interpretation of the OOP concept is that it is a style of programming that focuses on creating classes (and objects of these classes), and both classes and objects are abstract data types (ADTs). A class contains methods for operating on/modifying data, while an object is a representation of a class which contains data and can access the classes methods. Inheritance allows a subclass (the “child” class) to inherit some or all of the methods of the superclass (the “parent” class), as well as being able to add new methods or modify/override superclass methods. Recursion involves a function calling itself to increase flexibility and efficiency. These OOP concepts are very efficient and can save both time and code. The flexibility provided by creating custom ADTs is also very useful and has a broad range of applications.

So far, I am enjoying this course, mainly because the programming concepts that we are being exposed to can save a lot of time (I like how Danny emphasizes that laziness is one of the central concepts of computer science), and because the material is more complex that of CSC108. However, I did like the hands-on approach that the CSC108 lectures had, however I find that being exposed to many examples of OOP and recursion (like we have been) is also beneficial to me. What I will start doing is tracing more code and playing around with the posted example code to get a more complete knowledge of how to practically apply the theoretical programming concepts that we are learning. I study the posted readings, but often find them to be fairly intense and complicated. I should further benefit if I look over these more carefully and do whatever practice exercises that are found at the end of some of them.

Overall, I like this course so far and find that it is interesting so far without being overwhelming.

Python 
The xkcd interpretation of Python
(http://xkcd.com/353/)

2 comments:

  1. TA: Organisation is good and restatement of the concepts of object oriented programming is good. Try to make your next post show a synthesis of your understanding of the topic beyond what you have read or heard in class.

    ReplyDelete