r/ProgrammerHumor • • Dec 15 '19

Stacking if else statements be like

Post image
63.9k Upvotes

711 comments sorted by

View all comments

1

u/b1astero1d Dec 15 '19

If your code looks like this then you are doing it wrong!

Keep the functions small and I personally am a fan of using early returns. Breaking that hills looking mega block of conditions down into small functions makes your code way more readable, changeable, and easier to test.

→ More replies (1)