Thursday, January 30, 2014

Week 4: Recursion


This week we did more examples of recursion, along with an explanation of the first assignment. I now fully understand what the assignment is about and what we are expected to do, and I started writing the code for it this week. This is definitely an interesting example and I like how the included GUI is very interactive. I think the console based version would not be user-friendly. I also like how the GNU General Public Licence is included in the starter code. I also finished the second exercise, which I did not find overly difficult, and now I'm comfortable with using exceptions.

The examples we did in class (nested depth and drawing with a turtle) strengthened my confidence in understanding recursion. Tracing the code also helped me, and made me realize that everyone has an intuitive understanding of how recursion works; personally I just find the application of it into computer science the difficult part. The turtle drawing example was very interesting, and showed the connection recursion has with art. This made me think of M.C. Escher's recursive and mathematical paintings.

I think if I start writing recursive functions in exercises and assignments I'll fully understand this concept. However, after numerous examples done in class I feel fairly comfortable with the material.

http://www.merretts.info/fullsize/escher/escher_hands.png 
Drawing Hands by M. C. Escher, 1948, Lithograph.
(http://www.merretts.info/fullsize/escher/escher_hands.png)

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/)