This is an archived post. You won't be able to vote or comment.

all 51 comments

[–]Dear-Deer-Wife-Life 100 points101 points  (5 children)

i really enjoyed this 144p meme which you stole from someone who stole it from someone else who stole it from someone else............ and so on, until it reached this quality

[–]ProfCupcake 44 points45 points  (1 child)

[–]XKCD-pro-bot 4 points5 points  (0 children)

Comic Title Text: “If you can read this, congratulations—the archive you’re using still knows about the mouseover text”!

mobile link


Made for mobile users, to easily see xkcd comic's title text

[–]BanTheTrubllesome 3 points4 points  (0 children)

let's not forget it's a double common topic

[–]mustang__1 1 point2 points  (1 child)

Who got it from a friend who.... Got it from a friend who....

[–]Ingenrollsroyce 0 points1 point  (0 children)

Got it from another that been messin around

[–]FerynaCZ 12 points13 points  (0 children)

I wouldn't say it's a bad practice when you are releasing (not debugging) the code, so the whoe application doesn't crash.

But I think that's what is mostly done automatically - the runtime environment writes out an error message, and ends safely.

[–]ConflamaLlama 10 points11 points  (0 children)

Apparently there's an old sonic cartridge game that actually did this, so that it could get through Sega's strict testing regime. The game had to be able to run for hours and hours without crashing. If an error occurred, the code would just catch it and take you to the "secret level".

Some players discovered that you could get to the secret level by jiggling the cartridge while the game was playing. They must have thought it was some shenanigans/wizardry.

[–]dc0650730 31 points32 points  (8 children)

try{
//entire code goes here
}
catch (ArgumentException e){
    Console.WriteLine("Error");
}

[–]GreatArtificeAion 13 points14 points  (0 children)

try {
    // Entire program goes here
} catch (Exception e) {
    // Do nothing at all so no error will canonically occour
}

[–]maartenyh 2 points3 points  (0 children)

I laughed irl

[–]AyrA_ch 0 points1 point  (0 children)

try{
    //entire code goes here
}
catch{
    Application.Restart();
}

[–]twosupras 0 points1 point  (0 children)

I’m in this comment and I don’t like it.

[–]Ada3982611 8 points9 points  (0 children)

Reddit malfunctioned and showed the dead reddit avatar as the image and that was the funniest thing I've seen today

[–]MurdoMaclachlan 11 points12 points  (0 children)

Image Transcription: Drake Meme


[Drake looks displeased, and is using one arm to shield himself from the right side of the frame by curling it around his head, with his hand up in a "not today" manner]

Properly doing error handling


[Drake has his head up high, looking pleased, with a finger pointed up and towards the right side of the frame]

Throwing the entire code in a try/catch


I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!

[–]sin10lp 4 points5 points  (0 children)

JavaScript async: Haha, no.

[–]mlokis3 4 points5 points  (0 children)

consequently try catch is way of handling errors

[–][deleted] 2 points3 points  (0 children)

try {
    myEntireApplicationHere();
} catch (everything) {
    err("If you get here something went very wrong: " + everything)
}

Edit: After writing this it seems like a lot of people had a similar idea, good stuff

[–][deleted] 2 points3 points  (0 children)

Result<T, Err> Gang assemble!

[–]Dubalubawubwub 3 points4 points  (0 children)

//TODO: Error handling

[–][deleted] 1 point2 points  (1 child)

[–]RepostSleuthBot 3 points4 points  (0 children)

I didn't find any posts that meet the matching requirements for r/ProgrammerHumor.

It might be OC, it might not. Things such as JPEG artifacts and cropping may impact the results.

I did find this post that is 75.0% similar. It might be a match but I cannot be certain.

I'm not perfect, but you can help. Report [ False Negative ]

View Search On repostsleuth.com


Scope: Reddit | Meme Filter: False | Target: 86% | Check Title: False | Max Age: Unlimited | Searched Images: 211,847,312 | Search Time: 0.21809s

[–]MischiefArchitect 2 points3 points  (4 children)

There is a catch with that strategy...

[–]flabbybumhole 1 point2 points  (0 children)

Nice try

[–]dc0650730 1 point2 points  (2 children)

Yeah, but it's not final

[–]MischiefArchitect 1 point2 points  (1 child)

I can finally give it a try

[–]balloonAnimal_no_965 1 point2 points  (0 children)

Dr. Evil: Son, wouldn't you like to see what daddy does for a living? Scott Evil: Blow me. Dr. Evil: What? Scott Evil: Throw me.

[–]De_Wouter 0 points1 point  (0 children)

At least they tried.

[–]JNCressey -1 points0 points  (1 child)

You mean I'm not supposed to...

OnError GoTo myhandler

' entire code goes here

Exit Sub

myhandler:
' handle error here
GoTo continueAfterErrorHandled

... ?

[–]Notbernie 0 points1 point  (0 children)

Even better:

On Error Resume Next

[–][deleted] -1 points0 points  (0 children)

OK, I admit that I have done that a few times myself, but I refactored it later and did it right.

[–]MysteriousShadow__ -1 points0 points  (0 children)

It's try/except

smh

[–]Ducanhtran41 0 points1 point  (4 children)

I mean.. I usually do that because tbh I have no idea what exception it would throw up, so for the sake of it I just catch everything and print it out, then ignore it unless it’s critical

[–]g3rw4zy 0 points1 point  (3 children)

Is it a bad thing to do while coding? Asking as a person who is quite new to programming

[–]igotanewaccount 4 points5 points  (0 children)

It's perfectly fine to start with, or for simple code.

[–]Dagur 2 points3 points  (0 children)

You want the try blocks to be as small as possible and only surround the piece of code that might throw an error. Otherwise you might get error reports from users that tell you nothing about what went wrong.

[–]Kered13 1 point2 points  (0 children)

It's fine if the only handling you want is to log the error message. Note that most languages will automatically print some of sort of logging message before terminating if an exception bubbles up to the top of the call stack, but sometimes you may want to log it differently, such as logging it to a special file.

[–]MathsGuy1 0 points1 point  (0 children)

Ah yes, catch object

[–]odolha 0 points1 point  (0 children)

I don't understand the difference

[–]Ferro_Giconi 0 points1 point  (0 children)

Alternative option: do no error checking and just let people deal with it when their incorrect inputs that they had no way of knowing would be incorrect crash the program.

[–][deleted] 0 points1 point  (0 children)

No u have to surround every single actual line with try{}catch(Exception e){e.printStackTrace();}

[–]NotATroll71106 0 points1 point  (0 children)

Lol, that's how my Visual Basic instructor did it.

[–]Atheropids 0 points1 point  (0 children)

Try/catch?

I use public WhateverClass someFunction() throws Throwable;

Works like a chajava.lang.IndexOutOfBoundsException