this post was submitted on 17 Jan 2025
235 points (99.2% liked)

Programmer Humor

32896 readers
1442 users here now

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

Rules:

founded 5 years ago
MODERATORS
 
top 14 comments
sorted by: hot top controversial new old
[–] cypherpunks@lemmy.ml 8 points 4 hours ago

except: pass

[–] Bosht@lemmy.world 10 points 5 hours ago

That's fucking hilarious

[–] xmunk@sh.itjust.works 58 points 8 hours ago (1 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.

[–] wizardbeard@lemmy.dbzer0.com 14 points 6 hours 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.

[–] TimeSquirrel@kbin.melroy.org 17 points 6 hours ago

Like putting electrical tape over your check engine light.

[–] DickFiasco@lemm.ee 35 points 8 hours ago
[–] konalt@lemmy.world 18 points 7 hours 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

[–] CaptainBlagbird@lemmy.world 5 points 7 hours ago

Yo dawg, I heard you like try-catch blocks

[–] 30p87@feddit.org 21 points 8 hours ago* (last edited 8 hours ago) (1 children)
[–] missphant@lemmy.blahaj.zone 6 points 6 hours ago
process.on('uncaughtException', console.error)
[–] devilish666@lemmy.world 3 points 5 hours ago

Push it to prod & see the world burns around you

[–] FiniteLooper@lemm.ee 6 points 7 hours 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!”

[–] Pickle_Jr@lemmy.dbzer0.com 6 points 7 hours ago* (last edited 7 hours ago)

It works on their machine though!

Donald Trump does coding.