Thursday, January 23, 2014

    This week, I learnt a lot about Object-Oriented Programming. I learnt something new about the way we write methods in Python. For example, we can write the type contract by using colon. Before 148, I wrote they type contract under the line of header. However, I write the type contract in the header now. Colons can also use in functions that make the form of the functions simple. During the class, I enjoyed the way we study. I enjoyed thinking about the questions. I mean not the general questions but the details of the functions running. I think the details are very important for a program. A small bug may result in a big trouble that makes the entire program fail. There is a problem happens to me: how to get start?. Specifically, I do not quite easy to start the first code. It is not about the language is English which is not my first language and not about I do not understand what the program want me to do. It is about the organization of the whole program; how to make connections between functions. Good news is I found a way to solve it. Before I start to write functions, I write general ideas in paper and organize the functions in paper. Then it is easy to write it in Python. It is not only easy to get start but also help me with the whole program. Sometimes I am not sure with the function I wrote. So I test the function in Python Shell. I am confident with the material in this week. I spent many times on thinking about the materials. Once I understand I noted it. Therefore, when I watch back, it shows me the percentage of understanding the materials. The Python program we learnt now is also taught in CSC108, but in 108 we learnt how to write and in 148 we seek more outstanding ways of programming. The biggest achievement I made this week was during Lab. I had many discussions with my partner and finished the Lab exercises. The Lab was going perfectly well. I learnt many things by practice.
Q: is that necessary to write a initial method if there are no instance variables in a class.

A: we do not need to write it and the Python runs well.

No comments:

Post a Comment