"Aww, all it takes is a little discipline." Yeah or I can set myself up to succeed.
Good contribution, rdiddly.
Apart from the checklists, which people tend to skip, most of it makes sense. Running everything through a pull request is a good example of something which slows down the process but which is still worthwhile IMHO.
That being said, I really dislike when too many of these constraints are enforced by the technology. In coding, like in driving a car, there are times when common sense overrides traffic rules. Sometimes, even in the best and most diligent teams, the build server turns red. In that situation you just need to quench the fire ASAP to keep it from spreading. You don't want to create a task in JIRA, you don't want to create a branch, you don't want to involve your colleagues in pull requests, and you don't want to wait for a hour for unit tests to pass. You just want to apply the simple fix or revert the commit.
And that's why I prefer moderate social pressure over some algorithm enforcing stuff. A good team will know why the rules are there, they'll be professional enough to stick to them 99% of the time, and they'll also be professional enough to break them the last 1% of the time.
Definitely. It's possible to override any of these things in our setup. Most of them can be overridden by the person doing the coding, but a few of them require the team leader's approval.
If the rules are overridden, it's logged in our issue-tracking system, and we can discuss whether it makes sense to keep the rule or get rid of it.
Not if you hire veterans.
Veterans make mistakes, just like all other humans. Sometimes they're sleepy or distracted or don't have enough time to think what they're doing through.
Also, veterans are more likely to have their own ideas about how to do things, and some aren't easy to compromise with.
Either way, why should I leave it up to chance when there are automated tools that prevent mistakes before they leave someone's desk?
I've moved my teams away from "discipline" as a solution. How many times has someone said "I'll stop doing this" or "it won't happen again" and then it does?
Discipline might work for one person (usually the one making the rules), but I've found that it's impossible to get a team to be uniformly disciplined. Even if you can do it, it's extremely time/labor-intensive.
There are many tools demonstrating that discipline doesn't work, such as Chrome add-ons that block Facebook. Even when someone understands they need to be disciplined and want to be, sometimes they just can't.
Some examples of replacing discipline with hard boundaries:
- using only languages with static typing
- rejecting commits with messages less than 3 words long
- rejecting commits without tagged issue(s)
- formatters (similar to gofmt) instead of a style guide