The concept is basically this:
Often new learners miss the double equals sign ==
and use a single =
instead. Instructors therefore teach them this method so that they are not stuck at simple programs.
With no compiler warnings enabled, if you do this:
if(buf = NULL)
You are basically assigning NULL to buf
, which is not syntactically wrong, and you would not get any warnings, but when you do this:
if(NULL = buf)
the compiler throws error because it knows you cannot assign anything to NULL.
Why Yoda in particular?
It's because of the character Yoda, from Star Wars, whose dialogues were styled in reverse orders, like " Blue is the sky".
You can read more interesting coding terms here.