Phil Nash
Developer Advocate for Sonar
John F. Woods - 1991 on comp.lang.c++Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. Code for readability.
if (condition)
avar = value, anothervar = anothervalue;
if (condition)
avar = value; anothervar = anothervalue;
Raymond Chen - The Old New Thing Microsoft BlogDesign for readability. Even if you don't intend anybody else to read your code, there's still a very good chance that somebody will have to stare at your code and figure out what it does: That person is probably going to be you, twelve months from now.
It runs better in production and
it is better to work with in development
JavaScript | |
---|---|
1. | |
2. | |
3. | |
4. | |
5. |
JavaScript | |
---|---|
1. | |
2. | |
3. | |
4. | |
5. | Unused assignments should be removed |
foo = bar + baz;
foo = otherFunction();
function add(a, b) {
return result = a + b;
}
JavaScript | |
---|---|
1. | |
2. | |
3. | |
4. | |
5. | Unused assignments should be removed |
JavaScript | |
---|---|
1. | |
2. | |
3. | |
4. | "===" and "!==" instead of "==" and "!=" |
5. | Unused assignments should be removed |