Sunday, February 15, 2015

Object-Oriented Programming

Now that reading week is coming up and we are half way through the course, it is a good time to reflect upon the concept of Object-Oriented Programming (OOP). In CSC108 last term, we only skimmed OOP by introducing classes and some basic methods. At first, I did not fully understand the true purpose of creating these classes and methods, however, after completing assignment one and the mid-term, I have gained a much better understanding. I especially came to realize how OOP takes programming as a problem-solving process where careful application and the break down of problems is required. Like I mentioned in my previous post, being able to break down a problem into manageable pieces and solving it by properly implementing classes and methods may be the hardest process yet. This is something that I still need to master as I had no idea how to even start assignment one at first.

Furthermore, there are three crucial components of OOP that must be understood - classes, objects, and inheritances. An object is an instance of class. For example, "hi" is an instance of the class str. A class is a representation of a type of object. In other words, we can say that it is the blueprint or template that describes the object. Inheritance is a very powerful concept where classes inherit a state and behaviour from their superclasses. One way I like to think of OOP is with the following model. First, let's take our hand as an example. The hand is a class and our body has two objects, the left hand and right hand. In this case, grab, push, and touch are applicable methods to the class. We can also implement a class called foot, which can inherit some (touch, push) but not all (grab) methods and behaviours from the superclass hand.

The term is half done and I think I have gained a much better understanding of OOP. I look forward to return from reading week to see what the course has in store.

Sunday, February 8, 2015

Recursion Recap

In this week’s class, we started to dig deeper into recursion functions, which I mentioned in my last post. This was a challenging concept to grasp at first. After practicing a lot of tracing exercises for recursion in class and in tutorial, I have definitely gained a better understanding of this function. When a recursion function is called, the function clones itself to make copies of its code, local variables, and parameters. There was an interesting example of recursion I came across while reading online. Imagine that the surfaces of two mirrors are exactly parallel with each other, then the nested images that occur are a form of infinite recursion. However, recursion doesn’t necessarily make the code run faster, nor does it use less memory, but it sure makes our code simpler and more concise.

In this week’s tutorial, we were able to do some exercise problems associated with stacks. I was able to implement my own recursion function to solve the problems and was surprised when it worked. My function gave the right results according to the examples assigned. However, I came to realize that I do not have a concrete understanding of recursion because I struggled while implementing them.

In the mean time, I am looking forward to reading week which is when I have more opportunities to review this topic.
"People often joke that in order to understand recursion, you must first understand recursion."

Sunday, February 1, 2015

Impression of First Few Weeks

With utterly no experience in the field of computer science, CSC108 was the only computer science course I took in my first term. Python is the first program I used to learn the basics of programming. Now, just entering the second term of my university career, I was anxious to walk into the broad classroom of CSC148. CSC148 is a different experience than CSC108 because the teaching style and expectations are quite different, thus it seemed a little bit intimidating. There was not a lot of material covered in the first few weeks of class, but the lessons were very rigorous and required a deeper level of understanding. We began learning about classes which was slightly touched upon in CSC108, so I wasn’t confident going into this topic. During lectures, I had a general understanding of the concept that was being taught. I definitely had a disadvantage compared to those who are more experienced with computer science. But I am not discouraged to learn and improve my skills in the field of coding. Some new topics I found interesting that was covered in lecture were the short-hand techniques and the turtle function, which I have never seen before. The assignment really tested our understanding of classes, subclasses, and inheritance and made me come to the conclusion that trying to break down a problem and know exactly where to start is by far the toughest part of this course so far.

We recently started to cover recursion which is a challenging concept. The tutorial really helped me gain a better understanding of how recursion works, but I am still in the process of learning how to properly implement these functions.

The test is coming up soon and, I am very nervous to see if I really do have a concrete understanding for the main concepts of this course. Good luck y’all!