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.

7 comments:

Ken Snyder said...

Pingback.

I would also add that on-the-job mentoring can be improved.

BlackWasp said...

Absolutely agree. Just because OOP is not easy (very little that is worthwhile in our business is) doesn't mean that it is poor.

I think it is interesting to compare OOP with another standard school topic - English. This is a difficult langauge to learn. However, apart from a very tiny minority, you wouldn't consider English a failed language if schools were failig to teach it correctly.

Ricky Clarkson said...

The state of our industry would be far better if graduates knew a bit of functional programming than a bit of object-orientated programming.

Because functional programming isn't a religion, but a well-defined paradigm, it's easier to use a little of it to write better code than it is to use a little of object-orientated programming.

DevTopics said...

You are correct... OOP is just another tool in the developer's toolbox. It's appropriate for large-scale applications, but probably overkill for website scripting.

But let's be clear: writing a large application in a procedural language is asking for trouble. OOP brings abstraction, encapsulation and polymorphism. These capabilities allow the developer to decompose a large project into thousands of black boxes. If done correctly, this dramatically decreases an application's complexity and negative side effects while increasing quality and reliability.

The author of the original article likely lacks the skill for abstract thought necessary for OOP. Not everyone is meant to be a programmer.

Programmer Productivity: The "Tenfinity Factor"

Dave said...

Whoa...

You completely misread, and now are mis-representing my article.

To the rest of you. Read the article, read all the comments, and draw your own conclusions.

regev said...

I guess I was never clever enough to understand what is so damn difficult about OOP? Inheritance? Abstract classes? Virtual methods? Private vs. public?
Beats me.

Soon Hui said...

regex,

the hard part about OOP, is not the concepts per se. It's the proper application part that is difficult.

When to use inheritance over composition, when to use abstract class over interface. How many layers of objects and how to arrange them...Design questions like those are hard.