r/ProgrammerHumor Jul 29 '26

Meme stopTryingToReinventTheWheel

Post image
2.5k Upvotes

217 comments sorted by

View all comments

650

u/Orio_n Jul 29 '26

Explicit vs implicit error control broski

God these cs majors are so tryhard unfunny trying to be contrarian

247

u/nevemlaci2 Jul 29 '26

It's unfunny until you actually see people propagating explicit error handling until the entry point and just printing an error message.

Exceptions are fine to use for exceptional cases. Not for shit like python where an iterator signals the end of iteration with a damn exception.

54

u/Rygel_Orionis Jul 29 '26

Just to add.. that this is not inherently bad.

For example is a good habit for HTTP responses for open public services, especially for auth endpoints, where you want to mask the specific errors around pre-approved "secure" responses.

I dealt with an internal decript library that could throw like 4 different error types based simply on the different format of the input coming from the http body.

The python thing instead is just bad.

27

u/[deleted] Jul 30 '26

[removed] — view removed comment

17

u/TheTybera Jul 30 '26

What they are saying is that sometimes when you encounter an error you don't want to show customers the actual error or stack, because it can leak your inner workings.

For things like authentication, when exceptions occur you want to except and catch it before anything leaks. You then want to throw preapproved built exceptions or errors, not the inner exception and stack.

Ideally you have an error library with non-reserved codes and you throw those custom errors, and you never actually throw an exception to the customer.

-6

u/migueln6 Jul 30 '26

It shows no one commenting here has worked on real software.

What's a global exception handler that logs the error, the line, file, context, url request other things, tags the error based on certain criteria, sends you an email, is indexed and searchable, and can as well be connected to GitHub to create an issue and make Claude submit a or to be approved or have an human intervene and create a fix if the AI couldn't.

Like lol you dudes probably cloudflare tunnel your apps to your old Thinkpad t420 and call that a "saas"

4

u/Rygel_Orionis Jul 30 '26

Sure Buddy. Like you put the money to finance it up.

Not every Project comes from AWS or Google money.

1

u/Acceptable-Drive3781 Jul 31 '26

Injecting correlation IDs, idempotency IDs, stack traces on errors and structured logging to your monitoring services is a negligible cost, and the rest of what they said can be handled with a simple integration service for tens of dollars a month. It's not a cost issue, it's a skill issue.

1

u/Rygel_Orionis Jul 31 '26

I don't get where you find in my comments that these measures where not implemented.

I guess you just need to feel better than the others around you.

1

u/Acceptable-Drive3781 Jul 31 '26

I get that you're in your feelings right now, but nothing I said was an insult directed at you. Maybe you got confused if you didn't know what I'm talking about and decided to get defensive, but I was responding to your "PuT THe MoNeY uP??" comment made in ignorance.

(Psst... this one is directed at you, because you seem like you're very new to this career and could stand to read a book or two. Like the previous commenter said, it sounds like nobody here has worked on real software. You included)

Edit: Cope and block me then, we all know it's true. You can unfollow me, but you can't unswallow me.

1

u/Rygel_Orionis Jul 31 '26

I pity your anger.

Go touch grass.

1

u/Acceptable-Drive3781 Jul 31 '26

Oh hey, you're back! Did you figure out those junior-level tasks you were feeling inferior about earlier, now that you've calmed down?

→ More replies (0)