Week 3
In the first few weeks, we should be coping with class method, which is a symbol of object-oriented programming. At the beginning, I was not aware of the benefits brought by it and thought it was troublesome. Now, after some lectures about class, I realize what we have learnt in 108 is not the true application of class. At least, in 148, we are so far told that a class is able to subclass from a superclass, and inherit a majority of its features, which makes it much more convenient for programmers in the real world application.
Also, after reading some material about object-oriented, I know that this sort of programming classify the real world problem by different classes, not by the way we need to program it. The most obvious advantage is that we can save tons of work. Every real world problem must share something common with other problems. So, we don't have to build a brand-new program for every problem, which means we can use the previous code if we solved the analogous problem before.
Clearly, there are still much we should learn about Python, and the class thing is just the beginning. In 108, we have 3 hours lecture a week, but it reduces to 2 hours in 148, which means we are asked to be more diligent after class. However, learning something new is always keeping people excited.
此评论已被作者删除。
回复删除Yeah! Object-oriented programing greatly avoids duplicate code!
回复删除