4 ms·
So, the advice is bad, as most people (including myself, no doubt), will write mediocre code, just by the shape of the distribution (assuming it's normally dist
by disgruntledphd2 6y ago
So, the advice is bad, as most people (including myself, no doubt), will write mediocre code, just by the shape of the distribution (assuming it's normally distributed, which is a strong assumption, but without data it's probably reasonable).
Advice that relies on people caring about their craft/having the skills to do the work well doesn't scale, so it's bad advice where those things aren't true.
- sydd 6y agoAlso in lots of cases you are in a hurry to meet that deadline that compromises code quality. Better to leave a comment in this case than nothing
- disgruntledphd2 6y agoYeah, especially if you do something weird. People have often done weird strange stuff that made sense when I finally figured out the reason. Time pressure (and particularly with contractors) can lead to some horrific long-term burdens of maintenance.
- magicalhippo 6y agoYou come a long way with avoiding direct calls in "if" clauses and similar, using descriptive variable names, and not trying to be clever for the sake of being clever. For example, instead of if (order.version > 1) ... assign it to a descriptive variable bool orderHasChanged = (order.version > 1); if (orderHasChanged) ... IMO this makes it much faster to read and understand, because it says something about the intent. It can also be easier to spot bugs. It's a bit more to write, but I find it makes a big difference when coming back to the code later on, and typing is usually not the limiting factor when writing code.