2014年1月31日星期五
Week 4
This week, I learnt about recursion which is a great way to prevent duplicated codes. But when I first time saw an example of recursion, I just think that I can understand it, but it seemed that I cannot come up with it. I realized that recursion is actually not so hard to write after I taking the second lecture in the week. The turtle example was very helpful for understanding how recursion works.
2014年1月22日星期三
Week 3 - Object-Oriented Programming
In my understanding, Object-Oriented Programming is a way, in the other word, a structure to write programs. And I think the easiest way to explain it is classes in Python. Instead of just writing functions and using functions in programs, we create our own classes, which can not only hold functions we write, but can also store data we need. When I wrote my program in the tutorial, I found that the code of the program was much more organized than just using functions. The OOP makes my codes much more readable. In lecture, I learnt about superclass and subclass which can save much time because we don't need to write duplicated codes any more which is another benefit of OOP. Using finished class is also quite easy, we don't need to memorize variables' name, and by calling methods, data stored can be easily modified.
订阅:
博文 (Atom)