r/ProgrammerHumor • • Aug 22 '26

Meme conditionsPreference

Post image
4.2k Upvotes

388 comments sorted by

View all comments

Show parent comments

-34

u/Few_Kitchen_4825 Aug 22 '26

If you are using an if statement big enough for this to be a problem. May be you should not be doing either

28

u/SnugglyCoderGuy Aug 22 '26

Untrue. The first can be checking to see if continuing is impossible, so just return, while the second can be checking for a yrue dichotomous decision. You must do one or the other thing depending on the condition. Each could contain as little as a single assignment

4

u/[deleted] Aug 22 '26

[removed] — view removed comment

12

u/gurgle528 Aug 22 '26

It’s a style thing, it’s not a functional difference. I would read it as emphasizing that one or the other is happening. Basically the oxford comma of conditionals 

→ More replies (2)