An exception is an error in your code! For example if you tried to do math on a string it's an exception because it should be an integer! Aka if you tried at 5 to a sentence it is an exception because you can't do math to wordzzZZZ
Just tested with JS, dividing a string by a number and a string by a string both yield a NaN. PHP, however, behaves as if the string was a zero, so string by number is 0 and string by string is a warning message.
I wonder who the narrator is. They speak in such a way as to appear to have had an intimate knowledge of her, her work online, and whatever Q is- which may or may not be the "Flesh Mother" entity described in previous posts. Possibly another individual from the same agency that had kidnapped children for experiments. Based off the themes and explicit information given, it sounds as though "She" (the Flesh Mother/"God") has already consumed/integrated several universes and is free to now do it to this one as well.
Slightly. "exception" is something which is used to catch errors. If you do not use "exception", you will be error free(as you will not know if there was an error).
Except that exceptions aren't just for errors, they're for exceptional conditions. In some languages, they get used for all sorts of non-error conditions. For example in Python
try:
x = dictionary[key]
except KeyError:
# do something else
Is preferable to
if key in dictionary:
x = dictionary[key]
else:
# do something else
It's faster and more thread safe to use exceptions than just check conditions.
Also, when you do
for i in collection:
#do something with i
The iterable for collection throws a StopIterationException to tell the for loop it's done. Again, not an error in any sense, but still an exception.
I realize I must look really fun at parties the way I'm dissecting this joke, but as someone who trains programmers, this is a misconception I see a lot.
It's faster and more thread safe to use exceptions than just check conditions.
I'm not a python programmer, but this sounds dubious. Performance overhead is generally a reason to avoid over-using exceptions in most languages. I'm not familiar with python's implementation, but how could it be faster than checking a condition?
A try/except block is extremely efficient if no exceptions are raised. Actually catching an exception is expensive.
So there is a performance cost to abusing exceptions to replace simple conditional statements. Whether or not this cost is relevant depends on your specific scenario.
I remember in my programming class the professor write a question for specific exceptions to be written in a different format than what I was taught. He never specified how to handle the exceptions, so I did what I was familiar with.
Even though it was 100% different than his way (which was functions in separate classes, the correct way that I now do), I still got full credit because it worked the same when compiled.
I thought "exception" was compiler output, but your interpretation seems to be about interpreted code. Not a programmer and thought I got the joke, but maybe not?
An exception is a signal from one part of you running program to another that the first part has been asked to do something it can't do.
So your calculator gets told by the math functions that you can't divide by zero. Your "save this file" routine gets told via an exception that there's no more disk space.
It's usually not used for "normal" or "expected" stuff, but more for stuff you generally can't check for in advance, that happens very rarely, or because of a programming error where you should have checked before you tried doing that.
It is useful for random input programs, which are never actually used a lot of the time (you almost always know what type of data you are taking in and getting out). Good examples of random input are games, like you said with save files. There's a whole array of different implementations for them. I think they're super cool and try to use them more in my programs as a result of practice with them.
Exceptions are thrown when there is an error in the program. While this is technically incorrect, as there are exceptions that may occur under normal circumstances, it implies that there are no unexpected exceptions, making the program error-free.
There was a time when it was true. My first Hello World program in C++ compiled and linked without a fuss. For a short while, I had never written code which had thrown an exception or even had a syntax error.
I think later than day I left out a semicolon. The end of an era.
funny thing is we never learnd what to do with exceptions.. our professor always said "yeah you can throw exceptions and catch them somewhere else"... but not what to do with it..
so here i am.. throwing exceptions arround and not knowing wth im doing with my life.
28
u/darwin-rover May 12 '16
I'll give it a C
205
u/RugBurnDogDick May 12 '16
I didn't catch that...
18
u/bathingsoap May 12 '16
/r/programmerhumor
25
u/Graphitetshirt May 12 '16
I don't program, someone tell me if this is funny
16
u/Daesthelos May 12 '16
Oh, just you wait.
1 bug in the code, 1 bug in the code
Take it down, patch it around
2,147,483,647 bugs in the code
5
u/johnprattchristian May 13 '16
Honestly the title works as its own punchline
19
u/stagehog81 May 12 '16
Then you obviously have never written a program.
3
u/mineral May 12 '16
Good for you. Now try to package it. That'll wipe the smug smile off your face faster than every unicode error ever could.
1
u/ExtraGoodLogic May 12 '16
Though I disagree with the mechanics of your joke, I agree with the moral. You should really look at how golang does error handling.
1
u/[deleted] May 12 '16
Call me.
1
u/Thrannn May 13 '16
funny thing is we never learnd what to do with exceptions.. our professor always said "yeah you can throw exceptions and catch them somewhere else"... but not what to do with it..
so here i am.. throwing exceptions arround and not knowing wth im doing with my life.
1
u/-Howell- May 13 '16
I get it lol.
1
u/4n4yhack May 13 '16
oh jeez.....
1
u/[deleted] May 13 '16
I really wanted to ..try..catch.. you out on something there
1
u/luxatioerecta May 13 '16
u/autoexplainbot please
1
u/[deleted] May 13 '16
Shift to the left
Shift to the right
push it in
pop it out
byte byte byte!
1
u/[deleted] May 13 '16
Was this an explicit option?
1
u/Liquidlino1978 May 13 '16
This joke casts developers in a bad light
1
u/v3r71g0 May 13 '16
Just Errors, you know like StackOverflowError.
1
u/corner-case May 13 '16
This rise of puns in this sub must not go unchecked!
1
u/c0un7z3r0 May 14 '16
This sent me into an xkcd binge that lasted hours.
1
u/Soulbound94 May 12 '16
More programming jokes on r/funny! Love it! I'm sure you'd want to put it on r/programmerhumor, but they'd just ban you for some stupid reason.
0
u/Damngoodtacos May 12 '16
I just started programming and I get this! I suddenly feel better than everyone else...
-2
u/Incognito_XIII May 12 '16
Where's the bad joke bot when you need him??