this post was submitted on 30 Jun 2023
66 points (91.2% liked)

Programmer Humor

32410 readers
1 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
[–] lowleveldata@programming.dev 14 points 2 years ago (1 children)

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

[–] fiah@discuss.tchncs.de 6 points 2 years ago (1 children)

exceptions are just fancy gotos

[–] wvenable@lemmy.ca 1 points 2 years ago

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

[–] HairHeel@programming.dev 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?

[–] cupcakezealot@lemmy.blahaj.zone 1 points 2 years ago

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

[–] speaker_hat@lemmy.one 0 points 2 years ago* (last edited 2 years ago)

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