Saturday 1 February 2014

Week 4

This week in class we learned a lot about recursion. The topic has been hard to grasp so I have been doing a lot of problems. The concept itself is easy to understand but the implementation for every problem is unique.

Also, this week we had exercise 2 due on Thursday. I found the exercise to be fairly straight forward and it covered the material we learned in class last week. The first part of the exercise was about raising exceptions and the second part was the try-catch method we learned in lecture last week.

This week in lab we worked on implementing classes and implementing classes using inheritance. I found it fairly easy to implement a class using inheritance. Overall I think I have a fair understanding of the material we have covered so far and look forward to next weeks material.

Sunday 26 January 2014

Object-Oriented Programming

Object-Oriented Programming (OOP) is a programming paradigm. OOP represents concepts as objects that have attributes which describe the object. For example the class Point itself is an object which has x,y coordinates as attributes. These attributes will describe the functionality of the object Point. The greatest thing which I have so far learned about OOP is inheritance. Inheritance is when a class such as Exception is used when creating another Exception class. For example, this is what the header of an inherited class would look like (class MyException(Exception) ).  This will allow MyException to inherit all of the attributes of the Exception class without having to repeat all of the code in Exception. Also in addition to the class header to actually inherit from the Exception class you would have to call the __init__ method on the Exception class as well. (Exception__init__()). There are many areas of OOP and this is just the beginning.