konalt
link
fedilink
307d

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

Yo dawg, I heard you like try-catch blocks

Snot Flickerman
link
fedilink
English
77d

Donald Trump does coding.

Lucy :3
link
fedilink
25
edit-2
7d

Average node bug solving

miss phant
link
fedilink
77d
process.on('uncaughtException', console.error)

Ship it.

It works on their machine though!

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.

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.

set -e

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

ℍ𝕂-𝟞𝟝
link
fedilink
English
56d

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

Skull giver
link
fedilink
16d

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.

@locuester@lemmy.zip
link
fedilink
English
26d

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.

Like putting electrical tape over your check engine light.

@FiniteLooper@lemm.ee
link
fedilink
English
87d

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!”

@Bosht@lemmy.world
link
fedilink
English
157d

That’s fucking hilarious

except: pass

Artemis
link
fedilink
56d

@Irelephant “Fixed dem warnings boss.”

Push it to prod & see the world burns around you

Create a post

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

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
  • 1 user online
  • 57 users / day
  • 338 users / week
  • 591 users / month
  • 2.31K users / 6 months
  • 1 subscriber
  • 1.65K Posts
  • 36.5K Comments
  • Modlog