Object Oriented Programming – continued
What are the other ways of programming?
The most prominent of the old styles of programming is procedural programming where software was designed based on processes. Ok, what does that mean?
It means that we just built programs in the order that they would do things. I don’t want to go into details because it would only serve to confuse you, and today you want to learn OOP anyway! The bottom line is that this old style of programming got messy really fast and made for buggy software that was (and still is) hard to maintain.
Why would you program the OOP way?
You build software in the OOP style to save time and money; OOP based software is easier to build and easier to maintain. Humans like to put things in boxes or categories to help them organize them; OOP is essentially doing that.
As I mentioned above, each of these objects (inside the program) have things that they do. These ‘things’ in programming-talk are called ‘functions’. So basically a function is a thing that an object can do. Objects can potentially do many things; as such you will often find objects that have many functions.
Ok, I don’t want to confuse you, but I need to clarify something: functions can also be called ‘methods’. So why call them functions or methods when they have the same meaning, why not just call them functions? The reason is simple and rather nerdy: functions are just slightly different from methods! For our purposes, it is sufficient to say that when a function exists inside an object, it is called a method.