Quote:
Originally Posted by Arevos
I think that you don't really have enough experience to judge the merits of OOP. If your sole experience of OOP is C++ and Java, then I suspect that you don't really have a complete understanding of OOP.
|
My main experience with OOP is in C++. I also have experience with PHP but never even saw a reason to look at OOP with it. I still standby my statement that inheritance is pretty evil in that a constant over riding of variables and methods is a junk way to design programs. If one were to use inheritance in such a way that things were only be added in the subclass and very very few overrides were in place, then I would be much more likely to use it without throwing up on the keyboard. The problem with this though is that program requirements are constantly changing. With procedural programming it's not a big deal if a function changes. Your entire pyramid won't fall over because a function is designed to do one thing and do it well (UNIX Philosophy) where as an object tries to be an "all-in-one" solution. When a subclass extends a parent class, it inherits everything. As soon as you want exceptions to this, you have nasty overrides in the subclass and if for whatever reason the parent class needs additional methods that are to NOT belong in the subclass, you must again do some nasty overrides to ensure they do not inherit this new behavior.
My overall point is that OOP has a lot of features that promote bad practice. If one were to take OOP and strip it of all these flaws, then it would be quite nice to write code for. If you say that C++ sucks at OOP then I'll take your word for it. Maybe one of these days I'll pick Python up since I've heard so many good things about it. Until then, I'll stick with good, old fashioned C. Besides, OOP isn't the second coming. You really aren't going to be *that* much more productive than in a non-OOP language. Again, I realize OOP is more than just in the language, but in non-OOP languages, the syntax causes you to think about objects in a proper manner and not like a kid in a candy store with dozens of new keywords that are just begging the programmer to do something stupid like multiple inheritance. Also it is
never acceptable to put everything under the sun in a
class {...}. Anyone who thinks that it is necessary for
all code to be inside a class needs a good hard slap across the face. Strong words, yes, and I realize I sound border-line douche-bagish, but you have to wonder who the hell taught this kids programming when they come out of college thinking OOP is a religion.