In a lot of programming languages, efficiency is almost always the guidepost. Sometimes, minimizing character count or line count is a “fool’s gold” measure of the quality of the code itself. Other times, unfortunately, engineers are judged not by quality at all, but rather the sheer number of lines of code produced – where more is, somehow, obviously better. Over my career, “how much code there is” has never been a very meaningful measure in any language.
But I’m here to talk about T-SQL, where certainly efficiency is a good thing to measure – though there are some caveats to that:
Read on for those caveats and what Aaron considers to be the hallmarks of high-quality code.