3 ms·
It's the difference between, say, length(foo) and foo.length() - any difference in cognitive load should be lost in the noise next to "this variable can be null
by Freaky 11y ago
It's the difference between, say, length(foo) and foo.length() - any difference in cognitive load should be lost in the noise next to "this variable can be null".
And given most languages in use today use = to mean assignment instead of equality, it's hardly "no reason".
- retbull 11y agoExcept if you do if(foo = null){} it won't compile in java which is exactly what you want to happen. So using it in java is just cognitive load and provides 0 benefits.
- lkbm 11y agoHabits are hard to break. Switching back and forth between habits leads to mistakes. There's a trade-off here. I'm not going to say one is definitely worth it vs. the other, but if we pretend the disadvantages of one option don't exist, we lose the ability to make appropriate judgements.
- retbull 11y agoI guess I didn't think about people using C/++ and Java together regularly.