|Do you know where your variables are?|
No matter what you see in the comments, either it's pro-OOP or anit-OOP, you should learn about OOP.
First its not that hard to learn (it's not nuclear science, it's not even math, relational database used to be math whatever that means!).
If there is one thing I learned about programming from PerlMonks website; it's there is several pardigms for programming(I dont remember the node name or author, sorry, but there is a specific node that I mean): functional, procedural, OOP, and ... well and more to come I hope! OOP will not corrupt your mind if you learn it.
Mostly people who attack it, are just turned off by other people who are so very ooh-no ooh-my pro-OOP. But OOP is really interesting, as many ppl say, and will continue to say.
OOP can be thought of in many ways, you can think of it as an upgrade to procedural programming, or the next logical step in the comp.lang evolution. In a procedural lang you manipulates data.
Just data you cannot manipulate anything that can not be seen as data!
Data are of course: Numbers(int, floats) and characters (strings!),data here is basically what ever you can insert from your keys in your keyboard...did i miss anything thing.
And functions are functions, anything you cannot describe as data, you had to code a functions to represent it, and still those function can only manipulates data!
OOP offers you a real way (by real I mean OOP is not just a theory, you have real implementation of its concepts) to manipulate more then just data, you can manipulate objects (and that is part why I think OOP implementations that don't support operator overload are missing a great deal!). Of course data can be objects, and objects can be anything. The gotcha here is, objects can only be anything that can be described in functions/methods and data; but hey, look around (at the different programs that exist today), that really almost anything!
So why not think of a button as a function that draw a button!
Don't you think it's better (a better and easier way to think when designing a program) to put a button object, on your window object (function..eek!), and add textArea objects and label objects to make a form!
Yes GUI programming is one area of design that benefits a lot from OOP.
So the bottom line is OOP is way of thinking when designing a program that is actually supported by langs that implement the concept and allow you to code what think the way you think it.
And yes if all you wanted to manipulate is just numbers and characters, OOP would not give you much of and edge.
But still its great to be here when you need it!
And believe it or not OOP offer you a lot more then what I said, take Inheritence, this feature proved to be a great way to organize and upgrade object. And offered a great maner of code reuse. Abstract object at the top more detailled ones as subs, and subs for subs...
A change in the the father Object with affect all its sons! WOW..thats impressive, not impressive to do, but to think about this way, and you know what you really code it that way, you can probably still do the same with regular modules. But isn't a lot more logical and fun to think about it in term of objects!
It really reduce the gap between modelling a program/system and the actual code.
I guess this is all.