I revisited my earlier posts and basically I agree with what I wrote before.
But as the course goes on, I find myself have a better understanding of what we did before. I would like to extend what I talked about before add something new.
In week #4, I said that I lost marks on assignment 1 because of the special method '__init__', '__str__', '__repr__', and '__eq__'. But now I know how to do it.
First of all, these 4 methods usually have same variables, because the variables they have are the key points in the whole class. For example, in the assignments, the class 'game_state' has a 'p' in its '__init__' method referring to players, because all the games are 2-player games and player is one of the key points in the class.
In addition, I have to mention that, in the '__eq__' method, except for comparing the variables as in the '__init__' method, we also need to compare the type of the inputs, using 'isinstance()' or 'type()', because sometimes the inputs might have the same value but it's not comparing the thing we want.
In week #5, I talked about tracing recursions. I said recursion was very hard and I didn't know how to write recursions. After practicing a lot, I feel much better about it (though it's still kind of hard for me and sometimes takes a lot of time to think of it).
Before writing code about recursion, we'd better think of some examples first.
Think of the base case, which doesn't need recursion, and write the code for the base case using if expression. And then think of a simplest case except for the base case that uses the recursion only once. And then extend it into more complicated cases, and implement the other part of the code(usually using 'elif' or 'else'). I also find that usually we kind of 'use' the base case as the condition of getting to the leaf of the tree(hitting the end of the recursion).
I went to Diane's office hours to talk about recursion and she told me that sometimes our code about recursion seems with no problem and very reasonable, but by the time we run it, it doesn't work well. When it happens, there must be something wrong with the logic, and the best thing is to try to trace it, begging with the base case I mentions in the last paragraph, and we'll find the problem. I think this advice is very helpful.
I would like to give special thanks to some of my classmates. They wrote clear and well-organized slogs and they have very good understanding of what we learned in CSC148.
I read their slogs every week, and learned a lot from what they wrote.
In addition, I had many doubts and much disappointment on the way taking this course because programming is really hard for me. Sometimes I didn't get what we have to know. But when I read the other classmates' slogs, I found that they have same problems with me and I'm not alone, which makes me less panic! Furthermore, they went to office hours, discussed with classmates and went through all the materials or googled them and solved the problems, which encourages me to solve my problems, too.
One more benefit they bring to me is that, as can be seen in my first two slogs, I didn't write much and they are almost all about feelings. I thought that's what the slog requires. But the other students wrote not only their feelings, but also put many key concept we must know on each topic and made summaries of the topics, with pictures and code. Then I realized that slogs are more like a combination of course notes and journal entries, and started doing it as well, which helps improving my writing of slogs.
They are:
Christian (My dear partner): http://christiangarciacsc148.blogspot.ca/
Celina: http://celinajiangslog148.blogspot.ca/
Huan Ling: http://huanlingslog.blogspot.ca/
Justin: http://csc148justinsong.blogspot.ca/
Toniee: http://tonieewtbeageek.blogspot.ca/
Humair: https://humaircsc148slog.wordpress.com/
(I can tell that They will get a good grade and good luck to them!)
Thank you all again!
No comments:
Post a Comment