Section 9 - OOPs


OOP stands for Object Oriented Programming. And, yes, it is important.


Programming is all about expressing how our world is organized and how it works. So the closer our programming structure gets to how we think about the real world around us, the easier and the better.


Of course when computers first became available they were rather limited in comparison with what we are using day in day out now. So programming had to be simplified to something that would be practical considering limited storage and processing power. Hence the use of so called procedural languages.


As more storage and power became available it became possible to better express our logic and data structures in a way more representative for the real world. How important this is, is illustrated by the adoption of object oriented programming in languages which were originally purely procedural. BASIC and PHP are examples of this.


So what is it and why present it here and now?


To answer the second question first: in the next few sessions we are going to dive into some programming in ActionScript 3.0, more in particular we are going to introduce re-usable code and programming in 3 dimensions. This does require at least some preliminary idea of what OOP is about.


The first question takes a bit more explanation. If we think about our world we think about objects, people, living creatues in general, concepts. All of these have properties and/or things they own, as well as being able to do things or have things done to them. We also tend to categorize this in ways where we combine whatever shares properties and methods.


In OOP we organize our programs along the same lines of thought:


categorizing leads to the creation of classes,


one particular element in a class we call an object,


and all of these can have properties and functions (the doing part), often referred to as methods when they are bound to an object and/or class.


OOP makes it a lot easier to protect ourselves against 'stupid' mistakes, by allowing access to methods only within the classes and objects to which they belong. To illustrate it with a simple example: you don't want to have a dog miauw and a cat bark. I first was going to use the example of making a pig fly, but probably some smart alec has already put one in a plane, so...


Different languages may implement these basic ideas in a slightly different way and syntax probably will differ. But essentially what I just explained covers the gest of it.


What I don't cover here, and what also is similar in all languages, yet different, are common ways of applying logic and including different data types. Logic through conditional structures, loop structures....Data types such as characters, numbers, strings...Structures such as arrays. But the logic behind it all is the same.






You are logged in with userName = anonymous


Not signing up and not logging in leaves you with username 'anonymous'. Nothing wrong with that, but it will make it difficult to find back your own content in blogs and comments and to leave your email address for us to answer individual questions you leave for us in the blogs or comments.