Software Architecture Principles by Bruce Lee – 5

Don’t indulge in any unnecessary, sophisticated moves. You’ll get clobbered if you do– Bruce Lee

This lesson from Bruce Lee reiterates the concept that everything should be as simple as possible to get the job done (remembering that our job may take a little longer than a sparring match – but then again may not).  I’ve been clobbered by my own (or other people’s) use of unnecessary over engineering/sophistication.  I recall working on some code that clearly was written by someone who had learned LINQ / lambda expressions and sure enough they did things like the following:

private void ExecuteSomething()

{

ExecuteSomething(x => {/*NOP*/}, false);

}

 

internal void ExecuteSomething(Action<SomeDTO> actionToPerform, bool update)

{

}

 

This was not only wasteful but also difficult for other developers (and me) to follow.  This was only complicated by the fact that this took place in a web application and caused a lot of thread jumping.  Don’t get me wrong, I love lambdas, but there is a time and place for everything.  This code was reaching and ultimately was off balance.  Unfortunately, by the time I saw it the original author was gone and I was the one who was clobbered.

Advertisements