Wednesday, January 16, 2013

Overengineering

Empty layers of abstraction that are at best unnecessary and at worst restrict you to a narrow, inefficient use of the underlying API. Michael Borgwardt
In the cases where we've considered things over engineered, it's always been describing software that has been designed to be so generic that it loses sight of the main task that it was initially designed to perform, and has therefore become not only hard to use, but fundamentally unintelligent. Darasd
It fascinates me how some people are willing to spend so much time and brainpower on the so-called "application infrastructure" they unknowingly replicate, rewrite existing frameworks--mature ones, even those they are already using; they turn a blind eye to economy of execution, development productivity, and the fact that these things often take longer than developing parts that actually fulfill the requirements.

I've recently seen many cases of over-engineering and over-tinkering.  For example my superior was recently fretting about object casting.  So basically we store our project configuration in a database table, and these configuration parameters are sometimes used as method arguments.  They also store the data type name for each parameter in the table.  And then they already do the casting during query result mapping.  And for some reason, they have a global Map of String and Object to retain the result, completely making all of that casting useless, and to use it as a method argument they have to cast it again from Object into the required type.  And he wanted to come up with generics and a layer of abstraction on top of, well, what it is I don't have the slightest clue--to "avoid object casting".  I was completely speechless.  My rationale is that object casting is unavoidable when you: 1. keep them all, of different types, as values of a single Map, 2. store them as strings in the database, and 3. use Java (in Scala you can do a type matching to avoid explicit object casting).  Although, well, now that I think about it again, this is probably not a case of over-engineering but probably leans more towards a case of uninformed engineering.