In today’s world, users hold all the cards. Or as Patrick Hynds of SDTimes, puts it – quality is in the eye of the beholder.
This is especially true when it comes to code. When a developers says their code is “optimized” what does that really mean? Code is judged by many attributes and perspectives, which makes it harder to define quality.
Hynds recently pulled together a list of the things to focus on improving, in order to ensure quality code. Here’s a look at a few:
Perhaps the hardest metric to satisfy for quality code lies in the area of performance. Users expect systems to be faster and faster to the point that instant is just good enough, and anything less is too slow.
The foundation matters
When setting out to construct anything, the foundation matters. Marketing, building construction and even literature succeed most when the opening or foundation is of high quality. Quality code has an even greater dependence in this regard since, in most cases, you are not writing machine language. We all depend on many abstraction layers, for better or worse, to do everything.
“It seemed like a good idea at the time…” is the post facto justification for many blunders, with common threads of not thinking about possible ramifications or just taking short cuts. Code smell represents the coding version of this often-heard lament.
Patterns and anti-patterns
A design pattern shows you how you should be doing things and how components should be put together. And, by the same token, an anti-pattern talks about what you should not be doing and how things should not be put together.
A popular video that made the rounds at the BUILD Conference called “The Expert” depicts a hapless engineer facing a room full of clueless stakeholders demanding impossible results. While exaggerated, these are precisely the kinds of things that must be stamped out early in a project to give the resulting code any chance of being acceptable.
Ultimately the best way to keep up code quality on a .NET project is to keep the requirements reasonable. Every other industry has realized this imperative, which is why we have laws that keep truckers from driving through the night on no sleep, and why there are studies required before medicines and surgical techniques are allowed. Winging it does not produce good, solid results, and code is no different.”
What kind of quality are you looking for? Share your thoughts in the comments section.