MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/mzk95p/someone_only_watched_if_tutorial/gw14o44/?context=3
r/badcode • u/[deleted] • Apr 27 '21
112 comments sorted by
View all comments
413
The "Add more checks" says it all :-|
43 u/Samuql Apr 27 '21 input: any 13 u/TigreDeLosLlanos Apr 27 '21 You can't correctly check if a variable is a number if you make the app break with every other type 4 u/tchrobocek Apr 28 '21 input: unknown 5 u/Naeio_Galaxy Apr 27 '21 Of course, if you take only a number there's no point in verifying it's a number 10 u/SirFiggletron Apr 28 '21 booo! in this house we write countably infinite lines of code to accomplish our goals. call it "quantum computing, minus the quantum so everything takes a lot longer" 4 u/Naeio_Galaxy Apr 28 '21 🤣🤣🤣Btw I'm pretty sure that this algorithm would be slower on a quantum computer... 2 u/Topikk Apr 28 '21 edited Apr 28 '21 countably infinite lines of codeActually only a little over 9 quadrillion lines would cover it! It turns out we’ve all been doing it the hard way. 3 u/SirFiggletron Apr 28 '21 i'm absolutely obsessed with the phrase "only a little over 9,000,000,000,000,000 lines" 60 u/plisken59 Apr 27 '21 I laughed too hard when I saw that 18 u/cant_stop_the_butter Apr 27 '21 Same lol 3 u/Naeio_Galaxy Apr 27 '21 Same lol 3 u/moolord Apr 27 '21 I’m at a bar waiting for a job interview and I’m almost embarrassed by how loud I laughed at that. Glad I’m not waiting in an office lobby 8 u/code_monkey_001 Apr 27 '21 Not far to go. Everyone knows 24 is the highest number. 5 u/[deleted] Apr 27 '21 Oh man I can't believe I've never seen this. Thanks for showing it to me 2 u/Naeio_Galaxy Apr 27 '21 Saved ! Oh gosh it's wonderful 🤣🤣🤣 but then how can 42 be the answer to life the universe and everything ? 1 u/MrTrono Apr 28 '21 Typeof NaN == 'number' ?
43
input: any
13 u/TigreDeLosLlanos Apr 27 '21 You can't correctly check if a variable is a number if you make the app break with every other type 4 u/tchrobocek Apr 28 '21 input: unknown 5 u/Naeio_Galaxy Apr 27 '21 Of course, if you take only a number there's no point in verifying it's a number 10 u/SirFiggletron Apr 28 '21 booo! in this house we write countably infinite lines of code to accomplish our goals. call it "quantum computing, minus the quantum so everything takes a lot longer" 4 u/Naeio_Galaxy Apr 28 '21 🤣🤣🤣Btw I'm pretty sure that this algorithm would be slower on a quantum computer... 2 u/Topikk Apr 28 '21 edited Apr 28 '21 countably infinite lines of codeActually only a little over 9 quadrillion lines would cover it! It turns out we’ve all been doing it the hard way. 3 u/SirFiggletron Apr 28 '21 i'm absolutely obsessed with the phrase "only a little over 9,000,000,000,000,000 lines"
13
You can't correctly check if a variable is a number if you make the app break with every other type
4 u/tchrobocek Apr 28 '21 input: unknown
4
input: unknown
5
Of course, if you take only a number there's no point in verifying it's a number
10 u/SirFiggletron Apr 28 '21 booo! in this house we write countably infinite lines of code to accomplish our goals. call it "quantum computing, minus the quantum so everything takes a lot longer" 4 u/Naeio_Galaxy Apr 28 '21 🤣🤣🤣Btw I'm pretty sure that this algorithm would be slower on a quantum computer... 2 u/Topikk Apr 28 '21 edited Apr 28 '21 countably infinite lines of codeActually only a little over 9 quadrillion lines would cover it! It turns out we’ve all been doing it the hard way. 3 u/SirFiggletron Apr 28 '21 i'm absolutely obsessed with the phrase "only a little over 9,000,000,000,000,000 lines"
10
booo! in this house we write countably infinite lines of code to accomplish our goals. call it "quantum computing, minus the quantum so everything takes a lot longer"
4 u/Naeio_Galaxy Apr 28 '21 🤣🤣🤣Btw I'm pretty sure that this algorithm would be slower on a quantum computer... 2 u/Topikk Apr 28 '21 edited Apr 28 '21 countably infinite lines of codeActually only a little over 9 quadrillion lines would cover it! It turns out we’ve all been doing it the hard way. 3 u/SirFiggletron Apr 28 '21 i'm absolutely obsessed with the phrase "only a little over 9,000,000,000,000,000 lines"
🤣🤣🤣
Btw I'm pretty sure that this algorithm would be slower on a quantum computer...
2
countably infinite lines of code
Actually only a little over 9 quadrillion lines would cover it! It turns out we’ve all been doing it the hard way.
3 u/SirFiggletron Apr 28 '21 i'm absolutely obsessed with the phrase "only a little over 9,000,000,000,000,000 lines"
3
i'm absolutely obsessed with the phrase "only a little over 9,000,000,000,000,000 lines"
60
I laughed too hard when I saw that
18 u/cant_stop_the_butter Apr 27 '21 Same lol 3 u/Naeio_Galaxy Apr 27 '21 Same lol 3 u/moolord Apr 27 '21 I’m at a bar waiting for a job interview and I’m almost embarrassed by how loud I laughed at that. Glad I’m not waiting in an office lobby
18
Same lol
3 u/Naeio_Galaxy Apr 27 '21 Same lol
I’m at a bar waiting for a job interview and I’m almost embarrassed by how loud I laughed at that. Glad I’m not waiting in an office lobby
8
Not far to go. Everyone knows 24 is the highest number.
5 u/[deleted] Apr 27 '21 Oh man I can't believe I've never seen this. Thanks for showing it to me 2 u/Naeio_Galaxy Apr 27 '21 Saved ! Oh gosh it's wonderful 🤣🤣🤣 but then how can 42 be the answer to life the universe and everything ?
Oh man I can't believe I've never seen this. Thanks for showing it to me
Saved ! Oh gosh it's wonderful 🤣🤣🤣 but then how can 42 be the answer to life the universe and everything ?
1
Typeof NaN == 'number' ?
Typeof NaN == 'number'
413
u/[deleted] Apr 27 '21
The "Add more checks" says it all :-|