6 ms·
I'm actually guilty of using Yoda conditions in anything but Lisp. It is now hardwired in my brain since I learned it early. I'm using it for the same reason as
by kdeberk 16y ago
I'm actually guilty of using Yoda conditions in anything but Lisp. It is now hardwired in my brain since I learned it early. I'm using it for the same reason as all other Yoda conditioners are, -Wall wasn't really an option then since the source code normally spouted 50+ warning lines due to some included header file.
- jallmann 16y agoI use them too, but can't figure out if TFA is being derisive or not. I always thought Yoda conditions were good defensive programming, especially in C-type languages.
- aaronbrethorst 16y agoI use Yoda conditions all the time. Never knew there was a name for it besides 'a good defensive programming convention to keep you from doing something stupid when programming C.'
- squidsoup 16y agoI liked the variation on this - Yoda Exception Handling (or the lack thereof): there is no try.