Is OOP over rated ? Some have questions.

The last decade has seen object oriented programming (OOP) dominate the programming world. While there is no doubt that there are benefits of OOP, some programmers question whether OOP has been over rated and ponder whether alternate styles of coding are worth pursuing. To even suggest that OOP has in some way failed to produce the quality software we all desire could in some instances cost a programmer his job, so why even ask the question ?

Quality software is the goal.

Likely all programmers can agree that we all want to produce quality software. We would like to be able to produce software faster, make it more reliable and improve its performance. So with such goals in mind, shouldn’t we be willing to at least consider all possibilities ? Also it is reasonable to conclude that no single tool can match all situations. For example, while few programmers today would even consider using assembler, there are times when low level coding such as assembler could be warranted. The old adage applies “the right tool for the job”. So it is fair to pose the question, “Has OOP been over used to the point of trying to make it some kind of universal tool, even when it may not fit a job very well ?”

You just don’t get it !

I am at a disadvantage when I discuss this subject. The problem is that I am a 100% procedural style coder. The closest thing to OOP I have dealt with in the last 20 years has been classic Visual Basic. It is very easy for programmers to say to someone like me, “you just don’t get it”. The problem with this argument though is that while I may be a “duck out of water” in the current programming world, there are plenty of programmers who have a lot more experience than myself, especially with OOP, who are asking similiar questions. So I decided to do a little research on the web to see if I can find some who are asking some of these difficult questions about OOP.

What others are saying.
Richard Mansfield:

I will start with one experienced programmer who has asked these questions, Richard Mansfield. His white paper entitled “Has OOP failed ?”
( http://www.4js.com/files/documents/products/genero/WhitePaperHasOOPFailed.pdf ) broaches this subject. Richard Mansfield has a very long history in technology. He was the  editor of Compute magazine for about 7 years and has written dozens of computer / programming books which in total have sold about 500,000 copies. A number of his books were on Visual Basic dot.net so he obviously had plenty of experience using OOP based languages. To quote Mr. Mansfield “There’s no evidence that the OOP approach is efficient for most programming jobs. Indeed I know of no serious study comparing traditional, procedure-oriented programming with OOP. But there’s plenty of anecdotal evidence that OOP retards programming efforts. Guarantee confidentiality and programmers will usually tell you that OOP often just makes their job harder.”
Intel Blog:  by Asaf Shelly

I found this interesting blog on the Intel web site with an article entitled “Flaws of Object Oriented Modeling” .
( http://software.intel.com/en-us/blogs/2008/08/22/flaws-of-object-oriented-modeling/ )
The author makes this comment about OOP:  “Now it is almost impossible to follow the execution flow. When you want to know what happened in your application when the error message popped up you have to go over all the objects and all the classes that the execution flow went through and many times execution flow travels between several member functions before leaving to another object. Following the execution flow today is almost impossible.”

Usenix article:  by Stephen C. Johnson (Melismatic Software)

To quote this article “Object-oriented programming (OOP) is an ancient (25-year-old) technology, now being pushed as the answer to all the world’s programming ills. While not denying that there are advantages to OOP, I argue that it is being oversold.”  and also “Object-oriented languages tend to burn CPU cycles, both at compile and execution time, out of proportion to the benefits they provide.”
( http://static.usenix.org/publications/library/proceedings/sf94/johnson.html )

From ATT web site: Bjarne Stroustrup

Bjarne Stroustrup said to be the designer and original implementor of C++ makes some interesting comments in an interview.
( http://www2.research.att.com/~bs/slashdot_interview.html )
To quote Bjarne : “Well. It was obvious to me 20-some years ago that OOP wasn’t a panacea. That’s the reason C++ supports several design and programming styles. ” and
“In the first edition of “The C++ Programming Language,” I didn’t use the phrase “object-oriented programming” because I didn’t want to feed the hype. One of the problems with OOP is exactly that unscrupulous people have hyped it as a panacea. Overselling something inevitably leads to disappointments. ”
“That said, OOD/OOP is my favorite way of approaching design and programming. It just isn’t the right style for every program and for every detail of a program. Some good abstractions are best represented outside class hierarchies. Trying to force everything into a hierarchy – especially into a single-rooted hierarchy – can give truly contorted programs. ”

Blogger and programmer Chris Turner

Chris Turner describes himself as “an agile architect and developer specialising in building large, scalable enterprise and Internet solutions” . In his blog he makes some interesting comments such as “I have therefore been moving away from the object-oriented development principles that have made up the bulk of my 17 year career to date. More and more I am beginning to feel that objects have been a diversion away from building concise, well structured and reusable software.”  and concludes by saying “I’m certainly building smaller, cleaner and better structured software than I ever was before.”
( http://skipoleschris.blogspot.co.uk/2012/04/life-without-objects.html )

Bitwise magazine:  Technical Editor Dermot Hogan

Dermot Hogan has some strong words about OOP in his article on Bitwise.
( http://www.bitwisemag.com/copy/bytegeist/bytegeist1.html )
To quote Dermot he says “in the twenty or so years since object-oriented programming emerged from the universities, there is not one single documented, cast-iron, nailed-to-the-ground, proven case study that OOP works.” and also “On the contrary, there is solid evidence that OOP doesn’t work. Just look around you at the numerous failed, over budget disasters in the IT industry.”

Department of Computer. Science and IT, University of Jammu

To quote a paper written by this universities CS dept  ( http://www.csjournals.com/IJCSC/PDF1-2/9..pdf ) it says : “The use of object-oriented technology (OOT) has been shown to be of great value in many market sectors, but to the use of such technology within embedded systems remain a challenge. Such systems require high execution speed and have high memory constraints. ” and ” The object-oriented approach is known to introduce a significant performance penalty in terms of memory and time compared to classical procedural programming. In this paper, we have analyzed the execution speed of the different programs generated by the compilers of C and Java. The investigation shows that the speed of execution shows considerable difference between the Object Oriented and procedural programming languages. ”  and they come to an interesting conclusion when they say “It is concluded that the Object Oriented Programming languages proves to be slower than the procedural programming languages in terms of execution speed than there counterpart.”
Sony Computer Entertainment Europe R&D
This public document appears to be set of slides of a very deep discussion of some of the pitfalls of “Pitfalls of Object Oriented Programming”, a lot of which to be truthful is over my head, but still very insteresting. It deals with game development, but some principles may apply to software development for the desktop.
( http://research.scee.net/files/presentations/gcapaustralia09/Pitfalls_of_Object_Oriented_Programming_GCAP_09.pdf )

A point which deserves more discussion !

Likely none of the above quotes (or articles) will change the viewpoint of most OOP programmers, but at the minimum it should open up the questions posed for more discussion. IT departments looking for different and better aproaches to software development should at least consider the possibility that there may be other ways to develop software which may solve some of their problems. Such examinations could lead to choosing different programming languages or different methodologies using your current languages. Personally I think Bjarne Stroustrups approach is more reasonable. It is not a matter of OOP or no OOP, but a matter of choosing the best methodology for the job. From my own personal experience I can also vouch that it is quite possible to write code using 100% procedural style coding with great success. Where performance and a small footprint are required, procedural style coding has many advantages.

Consider other programming languages.

Take a look at this Tiobe Index of programming languages, 2012:
( http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html )
Not all programming is being done with purely object oriented languages. Interestingly C, which is more procedural in nature than C++, is the top programming language in their list. Likely there are a number of the top 50 programming languages which are more procedural in nature. Some languages likely blend procedural coding with OOP better than others do. The reason all these different languages exist is they all have different strengths. Some may be better suited to web development, while others may be better suited to high performance applications. Consider what your needs are and then find a language (or languages) which better suit those needs.