Wednesday 22 January 2014

Object Oriented Programming (OOP)

Essentially with OOP we can do anything.
Well... almost anything.

Object oriented programming allows us to create an object with special properties (a.k.a attributes) and methods (stuff that we make the object do). OOP is a way of structuring a program.

In order to create such an object, we first have to create the class (or "blueprint"). This class outlines all the methods and special attributes the object possesses.

For example: Lets make a baby. Below is an example of a program that contains the blueprints to creating a baby.



OOP is an interesting and fun way to program in python. Writing an OOP is similar to storytelling. As the programmer, you create objects and what they can do. You can choose what objects interact with each other and what properties they have. AS the programmer you control everything. 


2 comments:

  1. I'm not sure if this was intended to be funny, but I absolutely died when I read "let's make a baby". Some sort of object-oriented programming pickup line!

    ReplyDelete