It dawned on me a couple of months ago that the very essence of programming is the routine. It isn’t classes, design patterns or other window dressing but the routine. I think the industry has to realise that the routine is the basis of programming, not the class.
I hold the (admittedly unconventional) view that object orientated programming is actually hurting the industry. Object orientated thinking causes you to overly obsesses over the object model and focus less on the computation you’re trying to perform.
Take refactoring, for example. Refactoring is the art of solving meta-problems in your code whose solution is orthogonal to the actual problem you’re solving. The aim of course is to improve maintainability but is the cost benefit really there, or do developers just like having pretty object models? Is a refactored code-base really that much easier to maintain? To be worth the money, it’d have to be 50% or more faster to develop against. I have a hard time believing this could be the case.
Moreover, it is exceedingly hard to design a good object model. Every application I’ve worked on has had deficiencies in its object model, that become apparently only in the very late stages of construction.
Even if you could design the perfect object model for your application it will quickly disintegrates, under the weight of maintenance, in to a collection of “bucket” classes with weak cohesion and tight coupling.
However, this does not make its contribution entirely worthless. Studies do show that object orientated programs are easier to understand than their procedural counterparts.
However, I get the feeling that a lot of the issues you run in to with object orientated thinking is a result of the failure of the failure to appreciate the power of the higher-order function.
With proper namespacing and aggressive use of higher-order functions, I think you can have more maintainable, more flexible programs without resorting to object orientated design.
When I’ve worked in that style on my private work, I’ve found that I focus on solving the problem and not trying to correctly factor the program.
Does anybody out there agree with me or am I just a raving lunatic?
Simon