2 ms·
I'm not sure why this has rule 8. Don't do this. This is handled by git blame and PRs. In regard to rule 5, I've found it's a bit more nuanced than: > Without
by Supermancho 5y ago
I'm not sure why this has rule 8. Don't do this. This is handled by git blame and PRs.
In regard to rule 5, I've found it's a bit more nuanced than:
> Without the comment, someone might “simplify” the code or view it as a mysterious but essential incantation. Save future readers time and anxiety by writing down why the code is needed.
What is idiomatic? Well that depends on nested organizational requirements merged with some community merged with developer experience.
I have some methods:
public void doSomething() {
myType foo = createType();
foo.monitor();
}
public myType createType() {
return new myType();
}
There are no comments. What's idiomatic about this? Well the doSomething tests needed a mock, so we get a random create method. Why did the doSomething tests need a mock? Because the organization wants code coverage this way. You have to assume, because of company policy, there's tons of these things everywhere. I hate the term "idiomatic" when it's more subjective than anything else.
- everybodyknows 5y agoRule 8: Add comments when fixing bugs. >I'm not sure why this has rule 8. It's oriented toward maintainers. Hence little attention to larger architectural questions or business strategy.