Saturday, February 21, 2015

Object-Oriented Programming Concepts

The midterms were alright, but I know I am still a little unclear on how to do object-oriented programming.
This lack of understanding is reflected on my midterms. The marks I lost were all due to the fact that I did not know what to include as my parameters under the __init__ method.

Here, it states that when creating the class Point, we can include x and y in the __init__ method to create a more general class.
I'm not sure what they mean by general, but I suppose it means that by setting x = 0 and y = 0 in the __init__ method, we no longer HAVE to include a parameter for x and y. If we want to change the value of x and y, we simply include it when we initialize a an object Point
Otherwise, if we had not included x and y in the __init__ method, you would have to create a point with another line of code each time, for example,
p = Point()
p.x = 3
p.y = 4
as opposed to just having p = Point(3, 4)

From my understanding, depending on what you want your program to do, you set the parameters of the __init__ method based on how much you will be using them. For example, with point, if the goal of the program is to find the midpoint and the distance from one point to the other, both functions need to utilize a point in space, which is why we need to initialize a point x and y each time.

After my attempt to explain object-oriented programming in my own words, I think I have grasped a better understanding of it.

...This is why geeks should write.


Sunday, February 8, 2015

Course Material

Just completed week # 5 of the course and I am really seeing how CSC148 is much more advanced than CSC108.

We didn't focus much on Object-Oriented Programming in CSC108, and by CSC148, we were expected to think about how to create our own class and figure out what functions we need, and I feel like I am still (!) struggling with that.

I find that I'm never very confident with my answers, whether it be on the quizzes or last week's midterm.
When I hand them in, I never have a sense of how I did until I get the results back.

I'm trying to figure out how to fix this.
Perhaps my understanding of the course material is not up to par.
I should probably go to the Help Centre more often.

But I feel like sometimes, even if I do the labs, it doesn't help much with the quizzes.

Another way to do better is probably if I take more time to do the practice labs.

Ah, yes.
Must manage my time better.

If I ever spend too long procrastinating and not focusing on school, someone please remind me to be as studious as Hermione Granger, as awesome (and graduated at the top of her class) as Alicia Florrick, as bright (pardon the pun) as Elphaba Thropp (she's "practically phosphorescent"), and as enthusiastic and passionate as Leslie Knope.