Thursday, October 31, 2013

Week 2 Material

This week, I have gained deeper understanding of ADTs by learning the stack example. I have also become more familiar with implementing a class as well as testing using unittests. I find that there are multiple ways of implementing a class and different approach would result in different run time. The recursion example really helped me understood how recursion is used, since I only had a very vague idea about recursion in the past few weeks. I think recursion is functioning similar as a loop, however, it works quite differently from for-loops and while-loops. while for-loops are executing the function on every element of the domain, and while-loops runs only when the given constraints are satisfied, the recursive functions recuse within the body of the argument.


Week 1 Material

I am currently reviewing the course material from the beginning and making up the missing posts.

This week, I have learned a basic understanding of recursion, exception, and the design of a program.   I think the main topic of the week is the design of a new class. initiating a new class, finding the function method of the class are the most crucial things while building a new class. Meanwhile, I have also learned how to attach new method to a class.

Monday, October 14, 2013

Recursion

Recursion is "defining something in terms of it self". For example, when carrying out a function, the function itself is a part of the execution. The function itself  is usually being carried out multiple times in it's body in order to accomplish it's goal.

I think recursion is similar to a loop but in simpler, neater expressions. However, even though it is quite useful sometimes it takes more time to process the meaning and functionalities of the code. 

Object-Oriented Programming

I have learned that python is an Object-Oriented Programming language, which is different from most of the other programs that we use. We are focusing more on creating objects that contains not only data but also have associated functions known as method.

I think this style of programming is very useful since the objects interacts as objects and concepts in the real world rather than having a long list of command. Every argument is clearly indicating the element or data that we are working with and each function corresponds to the goals that we are trying to accomplish. Objects and functions interacts with each other and forms an organized system. Therefore, It is easier for programmers to build up, keep track, find errors and easier for users to understand.