this post was submitted on 04 Jul 2023
383 points (97.8% liked)

Programmer Humor

32396 readers
646 users here now

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

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 41 points 1 year ago* (last edited 1 year ago) (2 children)

You know at least it printed an error. I hate when things silently swallow errors.

I'm looking at you, Python programmers:

try:
   <100 lines of nonsense>
except:
   pass
[–] [email protected] 29 points 1 year ago (1 children)

We are not savages now we use

with suppress(Exception):
    > 100 lines nonsense
[–] [email protected] 27 points 1 year ago* (last edited 1 year ago)
[–] [email protected] 1 points 1 year ago

I am in the process of fixing a bug at work where pretty much every method has a try(Exception e){...}catch{LOGGER.error(...)}. The method calling my team's method needs to know when an interrupted exception is thrown. So far I have fixed this in 10 different methods, and we keep finding more. It's like playing whack-a-mole.