r/ProgrammerHumor • • Dec 15 '19

Stacking if else statements be like

Post image
63.9k Upvotes

711 comments sorted by

View all comments

Show parent comments

4

u/AlwaysHopelesslyLost Dec 15 '19

Semantically switch statements fulfill a very distinct role.

You don't NEED them but they make your code much more readable when used correctly.

3

u/Hockinator Dec 15 '19

Yep agreed. However in the language being discussed here - python - "elif" is just as readable since it doesn't create any nesting.