In the week 4, I learned the recursion in the lecture. In the lecture, professor used the example of nest list to introduce recursion. And I have learned how to trace the recursion. I really like this part because after tracing a recursion function, I always can surprised by the result and I will know how this recursion function work. Professor always give another recursion example - draw turtles.This is very helpful for me to understand how the recursion work. And I think this week's content is easy to follow and I think I'm able to tracing a recursion function.
In this week's lab, I have written classes representing various kinds of vehicles. And this lab's goal is to make me explore and understand inheritance.I have learned how to build a class and how to use subclass.
In this lab, it's my first time to use unittest framework to test my class. Then I know how to determine good test cases and use unittest.However, I think I still need some practice to remember the style of unittest framework.
In short, in this week, I start to learn recursion function and practice on building class and use unittest to test my code.
2014年2月20日星期四
2014年1月21日星期二
SLOG Week 3 - Object-Oriented Programming
In the week 3, I learn the Object-Oriented Programming.
Object_Oriented Programming, which is also known as OOP, carries an significant
meaning in the field of computer science and represents almost the whole part
of all the mainstream computer languages, such as C++ and Python.
In the lecture, I know some glossary like attribute, class, instance,
method.attribute is one of the named data items that makes up an instance.
class is a user - defined compound type. A class can also be thought of as a template for the objects that are instances of it.
instance is an object whose type is of some class. Instance and object are used interchangeably.
method is a function that is defined inside a class definition and is invoked on instance of that class.ALL the material covered in the past 3 weeks has been interesting so far, so I have no complaints about the course, and it has not been ovwely challenging at all. And the exercise is very helpful for me to review the information I learn in the lecture. That's a good practice.
订阅:
博文 (Atom)