Thursday 23 January 2014

Object-oriented Programming

Object-Oriented Programming uses Objects and Classes.


An object is a piece of code that can carry out a set of activities, it should mirror the real world. For example a dog in the real world has a height, name, breed. The object, in the code should represent all the parts of the dog.

A class is the blue print that takes the object and puts it through a process line. If we are to take the dog for example again, the class describes the details of the object. A class also initiates the object, to give to your object some tangible values. Height will be 17 inches, name will be Geoffrey and breed will be Soft-coated wheaten terrier.

The approach of Object-Oriented programming is to model a program and then be able to use it somewhere else with a different set of values. The programmer wishes to manipulate the information with logic rather then to manipulate the data.


Some Object-Oriented languages are: Python(obviously), Ruby, Java,Visual Basics, MATLAB, Perl, C#, C++