• I wonder why in WordPress code equality checks are done in reverse of what you would expect.

    So instead of $var == "string" we will see "string" == $var.

    It bugs me because it is so extremely counter-intuitive to start with the thing you want to compare against. It feels to me like:

    if ( false === $terms ) {

    the emphasis is on “false” and not on “$terms”. But “false” has not a great deal of meaning or dimension to it, any time you encounter it it will be the same. The real wealth and that which should get my attention is the variable that is being compared.

    So I’m sure there is a reason for this but I’m also sure it is not a very good one. Can anyone explain the reasoning behind this?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘false === $terms’ is closed to new replies.