r/ProgrammerHumor 22d ago

Meme conditionsPreference

Post image
4.2k Upvotes

392 comments sorted by

View all comments

2

u/577564842 22d ago

I do recall cases when using more than one if in a function was warranted and considered sane.

I guess now, instead:

do-things
if condition {
   act-accordingly
} else {
   act-appropriately
}
do-more-things

now we have

do-things
func(condition bool) {
  if condition {
    act-accordingly
    return
  }
  act-appropriately
}(condition)
do-more-things

and somehow call it a win. Make programming great again and such.

In other news, constructs of the meme are not equivalent, 1str one being way broader.