r/programminghumor • • Mar 02 '26 • Bravo 1

Cursor would neverrr

Post image
2.3k Upvotes

155 comments sorted by

View all comments

6

u/praisethebeast69 Mar 02 '26

hypothetically if you need things done in a certain order it could make sense, but I can't think of a code example for the life of me

2

u/__Blackrobe__ Mar 02 '26

What about

if dest == "xxx":
 query_db(team_a_db)
 push_to_jira(team_a)
 notify_slack()
else:
 query_db(team_b_db)
 notify_email(team_b)
 notify_slack()

5

u/praisethebeast69 Mar 02 '26
if dest == "xxx":
 query_db(team_a_db)
 push_to_jira(team_a)
else:
 query_db(team_b_db)
 notify_email(team_b)
notify_slack()

4

u/Zakreus Mar 04 '26

or

if dest == "xxx":
  query = team_a_db
  jira = team_a
else:
  query = team_b_db
  jira = team_b

query_db(query)
notify_email(jira)
notify_slack()

2

u/Altruistwhite Mar 03 '26

Bro still found a way to remove boilerplate

2

u/Mundane-Emu-1189 Mar 06 '26

this is obviously a contrived example but I think in some cases it makes more sense to leave them separated