3 ms·
Just nitpicking: "a+b+c+d" in C is equivalent to "((a+b)+c)+d" not to "a+(b+(c+d))". I otherwise agree with your comment: in most cases, unnecessary parenthes
by teo_zero 3y ago
Just nitpicking: "a+b+c+d" in C is equivalent to "((a+b)+c)+d" not to "a+(b+(c+d))".
I otherwise agree with your comment: in most cases, unnecessary parentheses make the code slower to read, just like unnecessary "==true".
- naitgacem 3y agojust a fun little anecdote. I wrote a piece of code that said ` if ( boolean_variable == true)` this was meant to be "if neither false nor null", since the variable was nullable (kotlin), until someone else tried to "fix the beginner mistake" :P luckily kotlin requires you handle the nullability and the other person immediately figured out what was going on. The other person was me, a couple of months down the line.
- MaxBarraclough 3y agoIf the purpose of quirky code isn't immediately clear from the context (and if the code can't easily be reworked to make it cleaner), it's a good candidate for commenting.