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.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment