Monday, 16 February 2015

summary of Object-Oriented Programming concepts

Talking about Object_Oriented Programming, I would like to say that almost everything, such as objects and classes, that we have learned though this course except recursion helps us understand  the Object_Oriented Programming well, which is short for 'OOP'. OOP is the way of programming in order to design the application more focusing on using objects rather than logic. In Object_Oriented Programming, we don't care much about how the logic goes between input and output, what we mainly care about is the objects that were mentioned in this application.
I remembered that at the beginning of this course, we were learned abstract data types (ADTs) in python including classes, attributes, methods, etc. According to the course notes,  "an ADT speci es the intended meaning of the data it stores, and the operations it provides on that data". The stack is an typical example explaining what we basically do with ADTs  with some general features of ADTs. A stack, obviously is the object and pop, push and is_empty are methods used to manipulate the stack. Also in our first assignment, we use OOP concepts  to make a game with five classes. Our first step is always to find out objects and operations needed by this object.
Inheritance is also a concept which is important and beneficial to understand OOP. Sometimes, we only have general features which does not satisfy some specific requirements. Employee, as an example that was taught in class, is the general object ( parent class). However, we have different kinds of employees under that parent class like hourly employee and salaried employee, which are named child classes used to implement the parent class. As a result, hourly employee and salaried employee share the same features as employee but have their own attributes on the other hand. This method is so helpful so that we don't need to overwrite the same code under a class.
In a conclusion, understanding Object_Oriented Programming concepts is pretty important to us because it is the basic stuff we need to know in order to make a further move into computer science. After I summarize the OOP concepts by looking over the whole thing from the course notes, I feel like this part of knowledge is much clearer to me. If we have something not familiar with, reading course notes over and over again might be a good way to get through.

Sunday, 8 February 2015

impressions of tracing recursion

Tracing recursion is my favourite part in this course so far. It is pretty interesting and for me, it is kind of easy to trace the output through looking at the code that is given. Everytime I see the code, thinking that how magical it is that the function itself goes into its own body code. I've seen the slog from http://sl0gforcsc148.blogspot.ca/, and there is a conversation which I totally agree with that goes like this:
       Student: "How do I learn recursion?"
       Teacher: "You have to know recursion to understand recursion..."
In order to understand how the body of function works, you have to understand what the whole function does. And then , useing a smart way with only a few lines to illustrate something which goes to unknown even to infinity

Although I love the way tracing recursion does, there is still one thing I'm worried about. I have no idea how to start if I'm asked to write a recursion by myself. We did the lab exercise in week 4 and there was a part asking us to write a code of recursion which confused me a lot. I know it won't be long to ask us write the recursion code by ourselves, so I still need more practice on that in order to fully understand the recursion part.

Sunday, 1 February 2015

Impression of first few weeks...

It has been four weeks since winter semester started. I was quite busy and tired during past few weeks even though a series of tests haven't come yet. It is much busier than last semester partly because I take six courses in total this semester, but mostly because the courses that I take are more difficult, especially CSC148. Every week there is only two hours' lecture plus two hours' lab for CSC148 but it covers more staff than CSC108. Besides, it is quite different than what I used to think.
When I first came to the lab, I got frustrated a lot. What I used to is basically implementing a class that has been given or understanding the code written by others. To tell the truth, I have totally no idea what should I do to design a class by my own through looking at the instruction even though I was learnt ways and several examples during lectures. It was the first time I realized that I supposed to work harder on that.
Thankfully, I get familiar with the course materials through reviewing the lecture slides and even Rampup slides. But I'm still worried about the oncoming test. Hopefully, I could survive after the test.