It’s the first week that I write about what I learn in CSC148.
During this week, my professor Danny introduces us a new method to write function, which is called “recursion”. And I heard from my friend who is now in second year that I will be studying recursion for the whole course. (Obviously, recursion is SUPER important)
Also, I have been working for the assignment 1 for past few days and I notice that I did not understand the class part well in CSC108. The assignment 1 makes me understand class deeply. By working on the assignment, I began to understand why some special method is important for class such as __init__, __repr__, __str__, and __eq__. I found myself easy to get lost when I am working on object because objects are always abstract unless I create something to demonstrate them in a readable way. Therefore, __str__ and __repr__ is important since i need to be able to read and understand what is going on in my program. __eq__ is important because it helps me to keep track of the object by differentiating different objects. Most importantly, the __init__ method, it is always needed for super class and sometimes needed for subclass. It helps us to know what arguments are needed for this class. In the assignment 1, it is important because it keeps track of the game state. I study CS because i want to build video games. In this assignment, I get to know how game should be like. Although it is a super simple game with no CG or something like that, I can understand how complicated is to create a whole video game.
Actually, i think i need to talk about recursive function a little bit even if i don’t really understand how it works by now. In my understanding, recursive function is to use function repeatedly but with some limitation which is called the base case. It remind me about the proof by induction in MAT137 which we need base case too. (LOL) If there is no base case, the function will keep looping and will never haunt ? (stop?) Maybe i should talk about it later since now i only know how to trace it.
See you next week! :D
No comments:
Post a Comment