Wednesday, 18 February 2015

SLOG3

Last week's term test result seems to be satisfied, and the course seems to getting on the right track for me. Everything becomes more and more clear and understandable. 

To be honest, I don't know what "Object-Oriented Programming" until I searched it on google just now. Maybe it was because I have only been focusing on how to program so far, but not the way we program, or I should say, the programming language?

Object-Oriented Programming is a programming paradigm based on the concept of "objects", which are data structures containing data, in the form of "attributes"; and code, in the form of "methods".

The one we are most familiar with is "class", but I have no idea what others might be since I have never learned them (if i understand materials correctly).  The idea is little bit  abstract but it becomes more and more clear after tracing programs more and more times. I think learning computer science needs lots of practice. It is not that you understand the concept so you can do well for sure. Sometimes actually writing the code down is more beneficial than just looking at professor and taking down notes.

Sunday, 8 February 2015

SLOG2

Recursion seems to be the first kind of "function" we have learned in CSC148 so far. Previous weeks were focusing on classes, which I used to be confused with, but started getting better. Functions are the parts in programming I like and good at, unlike classes. But does this make sense? Methods in class are just functions we create outside of class, how come I am confused with methods but not functions? To be honest I have no idea. It just seems like putting stuff all together is confusing and hard to understand and organize?

Anyways, recursion seems to be an interesting topic I have never seen before. It takes the function you write in side the function itself, which is really cool. This reminds me of the "clever" function my instructor taught in the last chapter of CSC165, which is about computability. And the "clever" function proved halt function did not halt or something...

The knowledge in CSC108 is getting back to my mind gradually during labs. For instance, last week's lab was about recursion, and the last function took me quite a few time. The reason seemed not to be that I did not understand recursion. I kind of forget that in order to put two lists together, I should just put a "+" sign between them. With the help of TA, I realized that. Surprisingly, it appeared on the test..

My impression for recursion is that if you put it only in one function consisting "if" and "else", it is easy to understand. However, if there are more lines before "if", this may cause confusion. For example, I want to set a variable or something, and when I call the function in "if", it will also set a variable again and again? I am not sure actually, and a little bit confused with this part which was not discussed in class, or maybe it just does not work in that case.