4 ms·
Stop Using If-Else Statements
- ReptileMan 6y agosince all state machines are reducible to a switch statement I kinda don't get the point of it all. You are moving complexity around, not reducing it.
- weitzj 6y agoI was expecting. „Just use early returns. Only in rare cases you might need an Else statement „
- gnusty_gnurc 6y agoThis reminds me of this pre-release book I'm reading from Manning. The author suggests a hard rule of avoiding if/else in functions. https://www.manning.com/books/five-lines-of-code https://www.manning.com/books/five-lines-of-code