May 05, 2003 | Category:

Abstraction Gone Too Far

There’s a moderately old article called “Don’t Let Architecture Astronauts Scare You” that I was thinking about recently.

A lot of programming languages allow for classes, generic classes and beyond. In the real world, companies insist on using object-oriented programming. Why? So they can re-use objects and methods at a later date. Now, outside of the codebase that the objects were originally created for, how often do you think they’re used? That’s right: close to nil.

Now, why have I been thinking about it recently? Because I’m being forced to use “generic classes” AKA “one layer of abstraction too far”. The chances of reusing a generic procedure in the real world? Absolutely nil. The things are too generic (you can basically only do assignment operations on them) to be useful for anything.

Abstraction is all well and good, but only if there is actually a need for it rather than when it could be implemented (i.e. all the time).