Saturday, January 18, 2014

Week 2

Week two was much better, in my opinion, as we started to focus on actual content. While much of the content were things that are still retained in my mind from last semesters csc108, there were a few things that caught my attention that were either new or different.

One thing that I noticed was that the way our professor likes to write type contracts is to do it in the parameters itself, using a colon to designate a type.
    ex: >>> def apple(colour : str) -> str:

I should quickly get used to this, because apparently that's what he wants us to do.

Another thing that particularly interested me was the usage of the property function in classes. It's something that prevents instances from changing, to make the initialized objects harder to modify. I'm still not quite sure how it works, but I plan on either going to a help session or going to the teacher to clarify this.

Finally, we learned recursion. So far, the examples are pretty basic. I'm sure the difficulty will ramp up soon enough, but luckily so far it's okay. Simply put, it's a function that calls itself.

P.S. the lab was okay. I felt that the instructions were not really clear, but maybe that's just me.asdasdasd

No comments:

Post a Comment