4 ms·
just 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 v
by naitgacem 3y ago
just 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.