In this week's study, I learned more methods
for classes, such as __init__, __eq__ and more. It was very challenging in the
beginning for me, because I find it confusing when I had to refer to instance
variables as "self". I had to trace example functions in lecture
slides into Python visualizer a couple times before knowing what each variable
is referring to.
The next step in learning this week’s material is
building classes on top of a superclass. I learned that a general class can be
made so that subclasses of it can ‘inherit’ many of its methods for their own
use. I find this very useful in solving computer problems in the future,
because it saves time for writing duplicate code, when you can just inherit
from another class, much like a parent and child relationship.
Also, I learned a little bit of recursive
tracing this week. This is something I still need to study on. I’m not quite
sure what does each step return at this time. Sometimes I get lost in tracking the nested function. To me, recursion is much like INCEPTION, each time
you call it, you go deeper into another layer. I wanted to go to office hour
for more clarification; however, I was too busy as I had the first assignment
to work on.
I find the first assignment very different from
the past assignments I used to do in csc108, because it is so open and
personalized. The instructor did not provide any specifications on what methods
to implement and what functions should be written; instead, they are all up to
the individuals to decide. I spent a long time thinking about the program
design, but I was still confused about what each general class should do. To
solve this problem, I went to the csc help center twice and talked to the TAs
there. They gave me a lot of helpful insights and assisted me in overtaking
this challenge.
No comments:
Post a Comment