this post was submitted on 17 Jan 2025
361 points (98.9% liked)

Programmer Humor

33090 readers
316 users here now

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

Rules:

founded 5 years ago
MODERATORS
 
top 20 comments
sorted by: hot top controversial new old
[–] [email protected] 92 points 1 week ago (3 children)

Still not as excellent as On Error Resume Next

Imagine the sheer ~~idiocy~~ genius required to add a language feature where, if an error occurred, the handling method is to just pretend that line of code never existed and continue onto the next line.

VBA is truly the language of savants.

[–] [email protected] 25 points 1 week ago

PowerShell does that by default, and it's my least favorite feature in my most used language.

$ErrorActionPreference = Stop

At the start of almost every script.

[–] [email protected] 3 points 1 week ago
[–] [email protected] -1 points 1 week ago (3 children)

So catching errors and doing nothing? That exists in every language except maybe BASIC?

[–] [email protected] 5 points 1 week ago

Catching individual errors is fine. Having all errors be ignored by default is weird.

[–] [email protected] 2 points 1 week ago

Very different. This means default ignore all errors and continue to the next line. You’d have to explicitly catch every line in most(all?) other languages.

[–] [email protected] 1 points 1 week ago

Ignoring every exception, including divisions by zero, is something I've never seen outside of BASIC and shell scripting. Even C and assembly will shit themselves when you do some of the shit that ON ERROR RESUME NEXT will ignore.

[–] [email protected] 43 points 1 week ago
[–] [email protected] 30 points 1 week ago (1 children)

I wrap every line of code in a try catch block, even my try catch blocks are in try catch blocks just in case the first accidentally drops it after catching it

[–] [email protected] 8 points 1 week ago

Yo dawg, I heard you like try-catch blocks

[–] [email protected] 30 points 1 week ago

Like putting electrical tape over your check engine light.

[–] [email protected] 25 points 1 week ago* (last edited 1 week ago) (1 children)
[–] [email protected] 7 points 1 week ago
process.on('uncaughtException', console.error)
[–] [email protected] 15 points 1 week ago

That's fucking hilarious

[–] [email protected] 12 points 1 week ago

except: pass

[–] [email protected] 6 points 1 week ago

Donald Trump does coding.

[–] [email protected] 6 points 1 week ago

I came across a stack overflow recently about how to do something in a jasmine unit test. Someone gave a solution of “I just changed the test to xit(“… and now there are no errors!”

[–] [email protected] 5 points 1 week ago

Push it to prod & see the world burns around you

[–] [email protected] 5 points 1 week ago* (last edited 1 week ago)

It works on their machine though!

[–] [email protected] 4 points 1 week ago

@Irelephant "Fixed dem warnings boss."