Good Design or Smart Engineering? May 30, 2007Posted by xk0der in : In My Opinion, Programming, Random Musings , add a comment
This is one question that haunts (new) software engineers day after day.
We learned from the days of BASIC to Java and .NET that goto is an incarnation of devil itself, but we find goto in code written by the so called ‘elite’ programmers. What does this mean? Was all that computer science we learned a crap, of no use?
Well the answer is a surprising “yes”! Well a complete yes will be a bit too overboard , but nevertheless, it is true to a large extent. From the little experience I’ve had as an software engineer and from what I’ve learned from the experience of the so called ‘elite’ programmers, Good design may not always be smart engineering.
What does this mean? Simply put, when writing code that will be used outside of the lab, in the real world, you should use the best possible solution. The best possible here refers to the solution which is faster, uses least number of resources and possibly adheres to other criteria that make your final code perform slick and cool stuff efficiently.
The above does not imply that you start writing obfuscated code! No, not at all. Read the above para again, the essence of engineering is producing efficient solutions not which are hard for other to understand, though this may result due to the efficient solution derived, but that is not the goal here. Science, or more specifically (in our case) computer science proposes ideal designs and assumes ideal conditions for those designs. In reality there is no ideal computer, no ideal processor and no ideal language and rarely do you get ideal conditions
So for the real world, when designing a solution, we need to take many factors into consideration. So a smart engineer will not be swayed away into the idealistic world trying to deliver an ideal solution. In the real world there are no thumb rules that one should (or would) follow blindly! These so called “thumb rules” are suggestion which may or may not apply to your solution.
Time is one of the major factors affecting the design of a solution. For companies to succeeded in todays cut-throat competition, it is not just the delivery of product that is important but it is the timely delivery that takes precedence. You would not like to fall behind your competitors, would you? So a solution that can be implemented in least possible time is at times the best, no matter how many rules of good programming design it may be breaking.
Engineers are not there to prove any scientific law or theorem, they are there to get things done, the most effective way!
Like this post?