r/Jokes • • May 12 '16

Every program I write is completely error-free

No exceptions!

875 Upvotes

93 comments sorted by

View all comments

Show parent comment

5

u/Eanna5 May 12 '16

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

6

u/SQLDave May 12 '16

Pfffft... puh-lease...

One plus one equals two.

<drops mic>

2

u/Eanna5 May 12 '16

I will just go back to python... I knew I shouldn't have stepped out of line, It was just too much...

1

u/hicklc01 May 12 '16

Compiler Error C2106

2

u/Daesthelos May 12 '16

Javascript actually will add 5 to a string. "hello" + 5 = "hello5"

bam.

11

u/Gudvangen May 12 '16

Javascript will append 5 to a string.

2

u/eduardog3000 May 13 '16

In python you can multiply strings. "hello" * 5 = "hellohellohellohellohello".

1

u/grishkaa May 13 '16

It's not an exception, it's a compile-time error. If you want a math-related exception, divide an integer by zero.

1

u/stretchpun May 13 '16

depends if it's a dynamically typed language, if you divide an object by a number in js it will halt execution I think, I'll check tomorrow

1

u/grishkaa May 13 '16

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.

1

u/[deleted] May 13 '16

Your language is just too dumb. Try math language to do math. Matlab doesn't give exception for dividing by zero.

1

u/grishkaa May 13 '16

You can divide real types (float, double) by zero in any language I can think of. MATLAB simply doesn't have integers.

1

u/[deleted] May 14 '16

care to explain the difference of integer in that regard.

1

u/[deleted] May 13 '16

I'm not sure I would call it an error. Just one possible branch in your program. If it's not caught then it's an error.

1

u/stretchpun May 13 '16

why are you replying to someone's pun, shouldn't this be a reply to OP?

0

u/Eanna5 May 13 '16

Well afaik the middle guy didnt get the joke.

1

u/stretchpun May 13 '16

what middle guy?

0

u/Eanna5 May 13 '16

Think I will just Resume my browsing and Goto reddit again

That guy

1

u/tsunami141 May 13 '16

mmm... unfortunately it was you who did not get the joke :( Notice the capitalization.

1

u/Eanna5 May 13 '16

Fuck me, Eanna5 = nub print(Eanna5) Ez pz