Quote:Original post by howie_007
The benefit of OOP relies on how well you understand it and can make use of it. It really comes down to how well you can design your objects to make use of inheritance, polymorphism and the benefit is code reuse. The other thing you can make use of with C++ and OOP is the concept of designing your objects based on an interface. If you've programmed Java you should be aware of this concept.
Except that this doesn't work in practice. Requirements change, domains change - if you can't adapt fast, you lose.
The pure OOP model is perfectly fine if you can fully, completely and permanently model the domain. In some cases, this is possible. In such domains, the actual cost of code change is irrelevant.
And for quite a while now, the IOC and DI approaches have been used to avoid OOP pitfalls in strict-OO languages, especially with regard to code reuse, adaptability and testing.
Quote:I would say OOP all the way. The more you think about your code on a higher level (as objects and not a collection of function and global variables), the better you will get at it.
The opposite of OOP is not functions and global variables. Those are implementation detail, not design choice. OOP also doesn't mean stuff is in classes, and OOP can be perfectly trivially implemented in C and it doesn't even require convoluted arrays of function pointers.
The opposite of OOP is data-centric model (or even functional programming). There is a data store which holds entire state, and there are lightweight stateless manipulators or agents which traverse this state. Unlike OO, this model is I/O centric collection of black boxes.
Or - the unix model. Everything is a file, applications read from files and write to files. It's not perfect, but it just works. When requirements or domain changes, data remains intact, and just select few tools need to be adapted.
Practice shows that such models simply scale better - not in performance (although they usually do), but in more important aspects as well (maintenance, TCO, ...). Anyone who has worked with J2EE will gladly attest it is not a pleasant experience - when such developers migrate to RoR (a toy framework in comparison) they feel like they can fly - and yet achieve everything they could before.
However - many projects are small enough to be fully expressed using either paradigm, and use of heavyweight frameworks is redundant most of the time. This is not intended to say that RoR is an enterprise replacement (it definitely is not, for many reasons), but most problems do not need enterprise-grade frameworks.
And as far as high-performance computing goes - it's all in datacenters these days. Giga-/Peta-bytes of files processed by simple scripts, or python on hundreds of machines.
What Java's OOP model do exceedingly well is its ability to absorb TDWTFs on which enterprises are built. And consequently, businesses are all about risk aversion today, so they favor it.