Friday, 31 January 2014

Week 4

This week, we focused on writing recursion.
Applied it on tree_burst function and nested list in class.
It was very interesting when professor showed us the outcome of tree_burst because I comprehend better when I see graphics and the difference between outcomes from different level was significant and it was very easy to find the pattern.

The lab we did this week was about exceptions and subclasses. Even though I worked alone, it wasn't very hard compared to the last week's lab. However, I still don't clearly know how to write test cases which was second part of the lab. I wasn't sure how we should be testing.

The exercise wasn't too bad either. It was pretty straight forward and I could easily get started on it. However, the autotester was updating the results once a day which drove me crazy and I hope it will get better.

Thursday, 23 January 2014

Week 3


Objected Oriented Language.


Procedural programming has been widely used until 1980s. Procedural programming contains procedures to operate a program and instructs computers what to do step by step. However, Object Oriented Language is widely used now and object oriented programming is very different from Procedural programming.

Object Oriented programming means that it sees programming as an object and an object has state and behaviour. State means variable or data and behaviour means function or code. For example, if we are programming a TV, the state would be screen, volume button, power button and so on and behaviour would be turing TV on and off or adjusting the volume. So, we can make state as data to change them and behaviour as method to utilise the state.

The main characteristics of object oriented programming are Encapsulation, Inheritance and Polymorphism,. First, encapsulation enables class to hide information from other class. Inheritance enables subclass to use methods from superclass. Polymorphism enables to name the method identically in different class and function differently in each classes.

There are many object oriented languages and python, the language we will be using in csc148 course is also one of them. Object oriented languages enhances reusability of a source or code that already exists and also, it is very easy to make some change to it or add other functions. However, its running time would be longer than language using procedural programming because the objects have to be stored in computer's data and information exchange between objects happens by exchanging messages.