How much code is enough code? Does the phrase “less is more” apply here? Some people take pride in condensing their code into “one-liners,” but the reality is that makes for obtuse, unmaintainable code where defects love to hide. Sure, there are some cases where gaining performance or some other type of efficiency justifies writing code that’s a little hard to follow, but as a general rule I avoid this kind of code whenever possible.
In the real world the true measure of the quality of someone’s code goes beyond how well it performs. High quality code must strike a balance between performance, maintainability, fault tolerance, and other factors dictated by the situation. The question remains, how much code is enough code? The answer, however unsatisfying, is: it depends.