387
all 21 comments
sorted by: hot top new old
[-] xmunk@sh.itjust.works 94 points 2 years ago

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 25 points 2 years 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.

[-] Cysioland@lemmygrad.ml 2 points 2 years ago
[-] intensely_human@lemm.ee -1 points 2 years ago

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

[-] HK65@sopuli.xyz 7 points 2 years ago

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

[-] locuester@lemmy.zip 3 points 2 years 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.

[-] DickFiasco@lemm.ee 51 points 2 years ago
[-] TimeSquirrel@kbin.melroy.org 33 points 2 years ago

Like putting electrical tape over your check engine light.

[-] konalt@lemmy.world 31 points 2 years ago

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 9 points 2 years ago

Yo dawg, I heard you like try-catch blocks

[-] 30p87@feddit.org 26 points 2 years ago* (last edited 2 years ago)
[-] missphant@lemmy.blahaj.zone 8 points 2 years ago
process.on('uncaughtException', console.error)
[-] Bosht@lemmy.world 18 points 2 years ago

That's fucking hilarious

[-] cypherpunks@lemmy.ml 16 points 2 years ago

except: pass

[-] FiniteLooper@lemm.ee 11 points 2 years 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 10 points 2 years ago* (last edited 2 years ago)

It works on their machine though!

[-] SnotFlickerman@lemmy.blahaj.zone 6 points 2 years ago

Donald Trump does coding.

[-] devilish666@lemmy.world 5 points 2 years ago

Push it to prod & see the world burns around you

[-] art_codesmith@toot.cafe 4 points 2 years ago

@Irelephant "Fixed dem warnings boss."

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

Programmer Humor

42872 readers
218 users here now

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

Rules:

founded 7 years ago
MODERATORS