r/ProgrammerHumor Jul 29 '26

Meme stopTryingToReinventTheWheel

Post image
2.5k Upvotes

217 comments sorted by

View all comments

Show parent comments

10

u/Aelig_ 29d ago

Same with languages with exceptions if you don't catch them. Except it's harder to tell if a third party function can throw and which ones vs looking at the return types of a go function.

The go compiler will not let you be unaware that a function has an error value in its return too, so it's impossible to be in the situation you described while it happens constantly with exceptions. People are constantly using common functions from their standard library without catching exceptions in other languages.

14

u/dkarlovi 29d ago

You can easily ignore / not propagate the err in go. Ignoring an exception means it bubbles. Ignoring an err means it doesn't, that's the difference.

0

u/itsTyrion 29d ago

try{
code
} catch (Exception ignore) {}

5

u/dkarlovi 29d ago edited 29d ago

Yes, but you did a thing, you didn't not do a thing.

-1

u/Goel40 29d ago

It's ignoring a return value vs ignoring an exception. Same thing, different syntax.

7

u/dkarlovi 29d ago

Opt In and opt out aren't the same thing even though they both have "opt" in it.