Saturday, 28 February 2015

Objective Oriented Programming and Mor

It's now the seventh week from the beginning of the CSC148.

 I finally tuned in with the idea of packing data and methods into classes. It not only became my way of writing code, but also put this "packing" into my thinking.  Although python dose not emphasize the security of member variable of a certain class, but by classing things up, it reduces the possibility of me accessing and creating random variables that flies around in the code.

Also I found some amazing similarities between the way we design our game and the way professionals design a game. I work part time with some enthusiastic people in the mobile gaming area. They implement games by a "Model,View,Controller" approach in which model handles the data and calculations, similar to our Game_State class and Strategy class. The controller links the model with the view,which is another component that display the game, similar to our View class.

I believe by practicing this structural programming, we are one step closer to be a real computer scientist and to develop functional applications on our own.


Sunday, 8 February 2015

Tracing recursion

In the previous post I said that tracing a recursive function or recursive call are somewhat mind-exhausting.

It's getting much better now since I found my own way of tracing by marking the layer of recursion and the control return signal. It surely adds some more steps to a regular recursion but made the process clear to me.

I added some SLOGers of on my list and I will be reading them as they are interesting.

Monday, 2 February 2015

First weeks in CSC148, start thinking like a Computer Scientist....start.....

What's up bloggers,

It is now the beginning of the fourth week of this semester.
We finished the first assignment, WOW~

I have been reading a few of peer's blogs and found some very interesting ideas. First I cannot agree more on the vagueness of statement in A1. Like what Simon and a lot other students said, the problem given in the first assignment is not quite clear. It surely caused me some confusion and I think it may also troubled other students.

Another point mentioned by the peers that I really agreed is that the coding for A1 is rather easy but figuring out classes and methods implementation is quite challenging. I personally attempted a lot of different versions of code and finally found a working one with descent classes and subclasses.

We have also started a new topic 'recursion' which is mind squeezing. I can feel my brain working at full power when tracing or writing a recursive function. Recursion is a magic way of coding but it is magically complex.

I hope I can somehow figure out the mechanics beneath magic and start to program like a Computer Scientist.