Thursday, 12 February 2015

csc148 Week 6 (Feb 12)

Summary of Object Oriented Programming


In fact, object oriented programming is the most controversial part for programming. When we comes to logic, it is absolutely right if it works as what we want in the code. Otherwise, it is wrong. However, the ways of designing a program varies a lot. There is no perfect object oriented programming but we can always make it better and better.

When we see a problem to design a class, the first step is to identify all objects they want to manipulate and how they connect with each other, which is not simple. This step may be time-consuming because we have a clear mind to program only if we get the general idea of the whole class.

How can I create a well-formed class?

Through about a month's study, I summarize some key points: set up more objects, design loose classes, emphasize type contracts. Objects should be clear and each of them has its function so that we can get what we want easily. Use more 'Not Implemented Error' to make classes loosely for us to easily reuse. Type contract tells us specific programming information so that we can avoid a large number of bugs.

I wonder what a 'block' is. Next time I will ask my TA.

I did not do well in the test and quizzes. But so far I have tried my best to study this course and really like it. I have read many blogs on the course websites and finally found one about which I have the same feeling. 'Yue Jiang' found very short codes which are hard to understand and imitate on the past exam.
When I first saw them, I just felt like that I was cheated by csc108. At today's labs I tried one-line code for several method and it really amazed me. I am glad that I can learn something by myself.

'Yue jiang''s blog:   http://jiangyuecsc148.blogspot.ca/


Thursday, 5 February 2015

csc148 slog for week5 (Feb 5)

Impression on recursion and the whole course so far


Recently we are learning recursion.I struggled to understand the idea and codes of recursion for a whole night and finally could apply it.

Although I did lots of revision, I felt frustrated after the test. I had no enough time to do it! It took me only 5 minutes to finish the recursion problem, and all the rest time to deal with those two classes. I could hardly understand the instructions in such a short time. I read the questions many times and just did them to my understanding.

To me, recursion is much easier than class and subclass. Recursion is more about pure coding. For class, we need to have a well-structured design and make the class understandable and reasonable, which is annoying to some extent.

I wonder how we can use '__defaults__' method. I have seen it on the course websites and knew the basic rules of this method but can't apply this well.

I randomly saw some other slogs by my classmates. And I found I had the same feeling with 'greywolf'. We are nervous, confused but still very into this course. Last year I didn't feel too much excitement about Computer Science, but now I think it is cool, even if I haven't been good at it so far. That's why I have motivation to try hundreds of times to make my file work in Shell during the whole night.

'greywolf's slog address:   http://greywolfvaind.blogspot.ca/