There is a lot of conversation regarding best practices1 in software development. I've seen at least three major points get a lot of discussion both on SE and elsewhere:
- What qualifies as a best practice, and why?
- Are best practices even worth discussing in the first place, because it's reasonable to assert that no practice is a "best" practice?
- When should you forego a best practice -- or perhaps most best practices -- either because it doesn't seem applicable or because of external constraints (time, money, etc.) that make the trade-off impractical?
Something that seems to come up far less often, but more than never, is a notion of common sense in software development. Recent experience has brought this notion to the front of my mind again.
My initial impression is that it is a different discussion than best practices, but with perhaps some cross-pollination.
When I think of common sense in general, I think of a set of rules that you've either picked up or been taught that give you a baseline to reason and make decisions. Following common sense is a good way to avoid you shooting your entire leg off. But beyond a pretty low baseline, common sense gives way to a need to make educated decisions, and educated decisions can even override common sense when the evidence seems compelling enough. I might be playing a little loose with the definition here, but I think it is close enough to spearhead my example.
When I think of common sense in software development, I think of all of the rules of basic hygiene to prevent a codebase from rapidly decaying into an incomprehensible mess. As examples, things like: not using a single global structure to maintain and communicate state within a non-trivial program; not using variables/method/class names that are just random gibberish; things that probably resemble what we've come to call anti-patterns quite closely. Where applying best practices the practical analogue to learning patterns, applying common sense could be seen as the practical analogue of learning anti-patterns.
With this in mind, I'd like to pose a few questions that seeing the answers of others for might help me reason my way through this.
Do others believe that there is a notion of common sense in software development? Would be interested knowing the reasoning either way.
If so, is it a notion worth discussing? Is it something we should push for as much as we sometimes do with best practices? Is it something worth pushing for even harder?
If the analogy to anti-patterns seems reasonable, the general rule is that anti-patterns are only employed if there is no other way, and even then only under very limited circumstances. How flexible should one be in allowing a codebase to deviate from common sense? It seems unreasonable that the answer is "not at all," because sometimes expediency demands deviations. But, it seems like a different sort of argument than when to employ a "best practice." Maybe it isn't; if you don't think so, I'd like to learn why.
This is far more opened ended and maybe worthy of a follow-on question all its own, what sorts of recommendations would you point at that seem like matters of common sense?
Other thoughts are also welcome.
1Perhaps I would do better to call them "commonly recurring domain patterns", but the name "best practices" is common enough that everyone knows what they are, even if they don't agree that they are. If the "best" part bothers you, just imagine I replaced "best practices" with something less authoritative sounding.