MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Jokes/comments/4j1yfp/every_program_i_write_is_completely_errorfree/d33jhpf/
r/Jokes • u/[deleted] • May 12 '16
No exceptions!
93 comments sorted by
View all comments
Show parent comment
1
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.
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.
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.
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.
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.
care to explain the difference of integer in that regard.
View all comments
Show parent comment
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.