3 ms·
It should be noted that Yoda conditions originated at a time when compilers didn't warn about accidental assignment, and linters weren't that great or had poor
by kstenerud 7y ago
It should be noted that Yoda conditions originated at a time when compilers didn't warn about accidental assignment, and linters weren't that great or had poor compatibility.
More often than not, the first solution to a problem isn't the best, but the best solution would take a lot of tooling fixes.
The Yoda condition trick is a relic of the past, well past its usefulness and best left in its grave alongside Hungarian notation, macros for "inlining", #include "blah.c", goto, etc.
- human20190310 7y agoStyle lives on, even after the practical purpose for it is no longer relevant. People keep wearing denim, even if they're not working in a mine.