this post was submitted on 30 Jun 2023
67 points (90.4% liked)

Programmer Humor

33722 readers
450 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
top 6 comments
sorted by: hot top controversial new old
[–] [email protected] 15 points 2 years ago (1 children)

Why use goto when you can throw exceptions to escape nested for loops?

[–] [email protected] 6 points 2 years ago (1 children)

exceptions are just fancy gotos

[–] wvenable 2 points 2 years ago

Exceptions are fancy returns. Everything else is fancy goto, including returns...

[–] [email protected] 2 points 2 years ago

Why use try/if/catch when you can use try/if/switch/catch?

[–] [email protected] 2 points 2 years ago

I don’t see a catch in the screenshot. Maybe this block just has a finally that cleans some things up before the exception is thrown?

[–] [email protected] 1 points 2 years ago* (last edited 2 years ago)

Why throwing an exception without a message, when you can use 0/0