Hack. Yoda condition. Useful for c-syntax languages






def method
if a == 52
#do something
end
end


Let’s suppose you accidentally wrote  a = 52, with one equal. Compilation will be successful, but the error still present.

If you change code to 52 = a, the error will immediately appear in compilation.

Comments