3 ms·
If you forget to type a 2nd '=', putting a constant as the left-hand-side will allow the runtime to error instead of treating the expression like an accidental
by filearts 13y ago
If you forget to type a 2nd '=', putting a constant as the left-hand-side will allow the runtime to error instead of treating the expression like an accidental assignment with potentially disastrous side-effects.
- jaegerpicker 13y agoIn some languages sometimes but in general I think that's the use case for yoda code.
- stevehawk 13y agoit goes back further than this.. in compiled languages it is a compile time error. So you don't run through 1/2 of your application before you run into it. Instead it shows up as soon as you run make/gcc/g++/etc.