Code: Select all
I'm sure I have stated this in a previous post. So I guess you must be running out of arguments or you are just arguing for the sake of arguing. But to add to my previous post, I can say that modeling the real world all the way through the development process using objects has advantages, among others it provides a level of abstraction which is maintained through out the process.
I must say that modeling the real world all the way through the development process has advantages, but objects does not model the real world very well. Abstraction is fundamental to all successful programming, it's not limited to OOP.
Let me ask you: Have you ever used another procedural language than Basic or C (which are very similar apart from the obvious high/low-level difference)? If not, you're really doing as you said we shouldn't: Judge a language.
One of the heavy OOP-things is code re-use. Units in Pascal (without objects) gives me exactly that. I turned a compiler into an expression evaluator by deleting one unit, changing one unit and keeping the six remaining units unchanged.
A lot of OOP-things are very good, but are not a property of OOP but rather of the language and implementation of the programming paradigm.
Edit:
Code: Select all
The idea is that you have different levels of abstraction. You can consider the car as a whole providing some functionality... or as the sum of its parts. Do you need to know that the car has wheels, engine, gearbox etc. in order to use it? No. You can "move" your car with out knowing the underlying mechanisms achieving such the goal (of moving you from one location to another). This is called encapsulation.
... and is not exclusive to OOP. Encapsulation is fundamental in the totally procedural pascal (or any language) if you want your program to be maintainable, extendable and readable. The difference is how encapsulation is performed or enforced.
Code: Select all
When one says "this is the way humans think" I guess one is considering the mainstream. We all have different presuppositions... this is why we are having this discussion. My intent in posting here is that I just didn't want anyone to leave this thread thinking that OOP is worthless... I wanted to state its importance in the industry.
OOP isn't worthless, in many cases it can be used with great success. It's just that I'm sick of listening to OOPers who present "OOP" concepts that are actually fundamental to procedural programming, and that they haven't understood such means that they should learn procedural programming better before they say it's bad. So I trigger a bit quickly.
But OOP isn't at all worthless.
(But FORTRAN sent man to the moon.)
But now its
10 Goto bed ; See? Encapsulation and abstraction of the memory address even in such a simple statement
Bottom line: OOP has some good uses, but it's not "better" or "ingenious" for absolutely all scenarios. At least I agree with that, put your own bottom line below mine if you want to!