Writing good code: how to reduce the cognitive load of your code
I don't understand the first example.<p><pre><code>    if (null != variable)
</code></pre>
If this was C, it should be NULL, and it is almost always better to just write `if (variable)` to check for NULL pointers instead.<p>If this was JavaScript, this check includes undefined too. Not sure why it didn't use triple equal.<p>If this was just talking about placing a constant value to be compared before a more complicated expression, I really don't see a convincing argument for either. Does switching the order reduce the cognitive load that much?