Saturday, 10 January 2015

Week 1

In week 1, we continued our transition from functional programming to object oriented program that we started learning at the end of csc108.  First we observed the incorrect way of defining methods, then the correct method using the __init__ method.
We began practicing by creating a class for a point, with various attributes and methods- e.g. giving a point coordinates & calculating the midpoint and distance between two points.
One point covered in the reading but not in lecture is the switch from emphasis on functions to emphasis on objects as the active agents, e.g. instead of "print_time(current_time)" we would use "current_time.print_time()".

No comments:

Post a Comment