Search This Blog

Loading...

Monday, June 2, 2008

No, OOP doesn't Fail Us

In the blog post Object Oriented Programming has Failed Us, the author explained why the Object Oriented Programming courses taught in the college is failing to provide a mass solution to the developers. He then stated that:
I really hate to say this, as much as I like object oriented programming but, I really think we might be better off if we went back to procedural programming for the bulk of the applications that we write and left the object oriented stuff to people who really understand it and for problems that can not be solved any other way.

I think the author was wrong on several things.

First, I don't think that the woeful state of the fresh programmers have anything to do with the OOP courses they learnt in school. Just because OOP is hard to master doesn't mean that it has to be responsible for all the failures. OOP is just a tool, a paradigm to write better program . It can simplify programming complexity, ease maintenance cost and encourage modularity, if used properly. But in the hands of the unskilled, OOP can generate layers upon layers of abstraction and obfuscate the real intention of a program.

But this is not the failure of OOP, rather, it's the school's curiculum that fails us. Instead of banishing OOP to post-graduate study or to footnotes, it would be better if the students were given more exposure in OOP.

The reason why there are so many pseudo-OOP code around is not because programmers are eagerly applying OOP patterns in their problems; rather, they are writing procedural programming code in OOP languages. Why not? Procedural paradigm is easy to understand; simple input and output and that's it. No class, no inheritance, no encapsulation and no high level thinking needed. All you need is to be able to write the solution in straight forward manner and code it. In fact, small projects are well-suited to procedural programming and it happens that homeworks and assignments are mostly consist of small projects. Students don't even have the proper exposure to OOP, and yet you expect them to become OOP masters upon graduation?

Imagine if, instead of shoving OOP aside, students are given a chance to learn OOP through real world projects, surely our existing codebase would have improved a lot. Mastering OOP requires a certain degree of abstract thinking and modeling ability, it requires training. The fact that schools don't prepare students for this contributes to the misconception that OOP has failed us.