My opinion on the
first few weeks of the course. The most difficult things and the easiest things.
Classes
The
most difficult part of designing a class structure was figuring out which
variables should be initialized in the parent class. I need to spend more time learning the concepts behind classes
because they are a powerful tool in python. I understand that classes are great
because they allow you to reuse code, but I have trouble finding what parts of a problem are reusable. In the first assignment, keeping the parent class general enough so
that it can work for multiple games, but at the same time getting all of the
information needed to make it work for a specific game was quite a challenge. I will have to go back and change how the assignment was written the first time because I don't think the classes were designed as efficiently as they could have been.
Labs
I found
that I was very lost during labs 1 and 2. I sometimes felt like I was in the
lab for a different class. It felt like there was a huge gap between what we
were being taught in class, and what we were expected to know for the labs. So much
so that I actually asked my teacher assistant what class the lab was for
during the first lab. When my teacher assistant was explaining how to approach
problems, they were writing code and using ideas we didn’t learn yet. At first I thought it was
just me, but after speaking with multiple people in my lab section, many people
felt like the labs were confusing. The third lab was definitely an improvement
from the first two. I found the recursion lab to be very similar to what we
learned in class, and I could actually follow along with what the teacher
assistant was talking about.
Python Style
I never
had difficulties following the style guidelines in CSC108. I think this is because
I want all of my code to have high readability and I like having my code
organized. I abuse commenting as much as I can because it helps explain to
group members what I did and why I did it.
Design Recipe
Examples -> Type Contract - > Header -> Description
-> Body
The design recipe has been ingrained
in my head, and I’m sure many students who took CSC108 would say the same thing
because we had a lot of practice writing functions using it. It is very
methodical and makes writing code A LOT
easier. Examples are the first thing written because they tell us what the
program will take in and spit back out. This is great because we can see where the program is heading, and part of the problem is figuring out what to make the function return. The type contract easily follows examples because all
of the information needed is contained in the example. I usually write the header and description together because they both use the same information. The header lets me put
words behind what each parameter in my example means, and what the function
will be called. I like naming my functions using a word that describes what
they do. I name each parameter based on its type contract and how it is used. The description explains to a user what each parameter is and what the
function is going to do with them. Finally, the most important thing to
implement is the body. Since everything else is done, it is easier to see what
is available initially, and how to build an algorithm to get the desired answer.
No comments:
Post a Comment