subreddit stringclasses 7
values | author stringlengths 3 20 | id stringlengths 5 7 | content stringlengths 67 30.4k | score int64 0 140k |
|---|---|---|---|---|
programminghorror | allbaseball77 | j4syiv1 | <|sols|><|sot|>Don't code when you're tired, lol.<|eot|><|sol|>https://i.redd.it/ctoohnqjhnca1.png<|eol|><|sor|>Been there - done that. Lucky for me, I don't do things like this anymore because my IDE acutally tells me that I've done something wrong on the line and tells me there is a shorter way to fullfill the statem... | 19 |
programminghorror | CorbecJayne | j4umbme | <|sols|><|sot|>Don't code when you're tired, lol.<|eot|><|sol|>https://i.redd.it/ctoohnqjhnca1.png<|eol|><|sor|>... just making sure. ..<|eor|><|sor|>But they arent, as the second condition wont be evaluated when the making sure is needed.<|eor|><|sor|>if argc == 4 then the second condition will be evaluated tho<|eor|>... | 17 |
programminghorror | caboosetp | j4s5rz4 | <|sols|><|sot|>Don't code when you're tired, lol.<|eot|><|sol|>https://i.redd.it/ctoohnqjhnca1.png<|eol|><|sor|>The problems is, I'm ALWAYS tired.<|eor|><|soopr|>I feel you. I can't sleep after I wake up, so if I wake up 4 AM to go to the bathroom I won't be able to sleep again.<|eoopr|><|sor|>That would suck if you co... | 15 |
programminghorror | _Capeman_ | qgwisy | <|sols|><|sot|>Well somehow that fixes it, so it stays<|eot|><|sol|>https://i.redd.it/ury3vrh5uzv71.jpg<|eol|><|eols|><|endoftext|> | 1,545 |
programminghorror | dcheesi | hi8v4by | <|sols|><|sot|>Well somehow that fixes it, so it stays<|eot|><|sol|>https://i.redd.it/ury3vrh5uzv71.jpg<|eol|><|sor|>If at first you don't succeed, try, try again!<|eor|><|eols|><|endoftext|> | 490 |
programminghorror | ThatDudeBesideYou | hi941e8 | <|sols|><|sot|>Well somehow that fixes it, so it stays<|eot|><|sol|>https://i.redd.it/ury3vrh5uzv71.jpg<|eol|><|sor|>Usually if you have to try a few times and it works on the second or third try, it means there's an asynchronous issue, and the thing that actually fixing it is the actual delay while throwing the first ... | 260 |
programminghorror | Yangishrobin | hi8zita | <|sols|><|sot|>Well somehow that fixes it, so it stays<|eot|><|sol|>https://i.redd.it/ury3vrh5uzv71.jpg<|eol|><|sor|>I just....I...it's hard to stay motivated in this field<|eor|><|eols|><|endoftext|> | 193 |
programminghorror | siddharth904 | hi8usnl | <|sols|><|sot|>Well somehow that fixes it, so it stays<|eot|><|sol|>https://i.redd.it/ury3vrh5uzv71.jpg<|eol|><|sor|>Ah yes the famous default: break;<|eor|><|eols|><|endoftext|> | 112 |
programminghorror | mailto_devnull | hi9r3s4 | <|sols|><|sot|>Well somehow that fixes it, so it stays<|eot|><|sol|>https://i.redd.it/ury3vrh5uzv71.jpg<|eol|><|sor|>Usually if you have to try a few times and it works on the second or third try, it means there's an asynchronous issue, and the thing that actually fixing it is the actual delay while throwing the first ... | 84 |
programminghorror | captnkrunch | hi961qh | <|sols|><|sot|>Well somehow that fixes it, so it stays<|eot|><|sol|>https://i.redd.it/ury3vrh5uzv71.jpg<|eol|><|sor|>I just....I...it's hard to stay motivated in this field<|eor|><|sor|>Find you a team that lets you maintain code. Flip off imposter syndrome and apply and ask these questions in the interview! See the Jo... | 84 |
programminghorror | _Capeman_ | hi9u8qf | <|sols|><|sot|>Well somehow that fixes it, so it stays<|eot|><|sol|>https://i.redd.it/ury3vrh5uzv71.jpg<|eol|><|sor|>Usually if you have to try a few times and it works on the second or third try, it means there's an asynchronous issue, and the thing that actually fixing it is the actual delay while throwing the first ... | 69 |
programminghorror | kgon1312 | hi9e7cj | <|sols|><|sot|>Well somehow that fixes it, so it stays<|eot|><|sol|>https://i.redd.it/ury3vrh5uzv71.jpg<|eol|><|sor|>If at first you don't succeed, try, try again!<|eor|><|sor|>*Lights will guuuuuuuide you home*<|eor|><|eols|><|endoftext|> | 64 |
programminghorror | javier123454321 | hib6rwz | <|sols|><|sot|>Well somehow that fixes it, so it stays<|eot|><|sol|>https://i.redd.it/ury3vrh5uzv71.jpg<|eol|><|sor|>Usually if you have to try a few times and it works on the second or third try, it means there's an asynchronous issue, and the thing that actually fixing it is the actual delay while throwing the first ... | 46 |
programminghorror | Lightfire228 | hiap0hg | <|sols|><|sot|>Well somehow that fixes it, so it stays<|eot|><|sol|>https://i.redd.it/ury3vrh5uzv71.jpg<|eol|><|sor|>Usually if you have to try a few times and it works on the second or third try, it means there's an asynchronous issue, and the thing that actually fixing it is the actual delay while throwing the first ... | 39 |
programminghorror | Never-asked-for-this | hi983yy | <|sols|><|sot|>Well somehow that fixes it, so it stays<|eot|><|sol|>https://i.redd.it/ury3vrh5uzv71.jpg<|eol|><|sor|>Ah yes the famous default: break;<|eor|><|soopr|>You dont know that. There could be Code before the break ;)<|eoopr|><|sor|>About 17 tabs to the right of `default:`?
That's herecy!<|eor|><|eols|><|endof... | 32 |
programminghorror | jmorfeus | hi9iqu8 | <|sols|><|sot|>Well somehow that fixes it, so it stays<|eot|><|sol|>https://i.redd.it/ury3vrh5uzv71.jpg<|eol|><|sor|>Ah yes the famous default: break;<|eor|><|sor|>What is inherently wrong with default: break?<|eor|><|sor|>It just does nothing, the default case is optional<|eor|><|sor|>I have it as mandatory in my lint... | 29 |
programminghorror | Bloodshoot111 | hi920lr | <|sols|><|sot|>Well somehow that fixes it, so it stays<|eot|><|sol|>https://i.redd.it/ury3vrh5uzv71.jpg<|eol|><|sor|>Ah yes the famous default: break;<|eor|><|sor|>That hurts the most<|eor|><|eols|><|endoftext|> | 23 |
programminghorror | _Capeman_ | hi952xi | <|sols|><|sot|>Well somehow that fixes it, so it stays<|eot|><|sol|>https://i.redd.it/ury3vrh5uzv71.jpg<|eol|><|sor|>Ah yes the famous default: break;<|eor|><|soopr|>You dont know that. There could be Code before the break ;)<|eoopr|><|eols|><|endoftext|> | 22 |
programminghorror | siddharth904 | hi9ajze | <|sols|><|sot|>Well somehow that fixes it, so it stays<|eot|><|sol|>https://i.redd.it/ury3vrh5uzv71.jpg<|eol|><|sor|>Ah yes the famous default: break;<|eor|><|sor|>What is inherently wrong with default: break?<|eor|><|sor|>It just does nothing, the default case is optional<|eor|><|eols|><|endoftext|> | 18 |
programminghorror | MJBrune | hiaqpl8 | <|sols|><|sot|>Well somehow that fixes it, so it stays<|eot|><|sol|>https://i.redd.it/ury3vrh5uzv71.jpg<|eol|><|sor|>I just....I...it's hard to stay motivated in this field<|eor|><|sor|>Find you a team that lets you maintain code. Flip off imposter syndrome and apply and ask these questions in the interview! See the Jo... | 17 |
programminghorror | engineertee | hi96t2e | <|sols|><|sot|>Well somehow that fixes it, so it stays<|eot|><|sol|>https://i.redd.it/ury3vrh5uzv71.jpg<|eol|><|sor|>Like everything in life, persistence is key to success<|eor|><|eols|><|endoftext|> | 16 |
programminghorror | MJBrune | hiakhfx | <|sols|><|sot|>Well somehow that fixes it, so it stays<|eot|><|sol|>https://i.redd.it/ury3vrh5uzv71.jpg<|eol|><|sor|>I just....I...it's hard to stay motivated in this field<|eor|><|sor|>Find you a team that lets you maintain code. Flip off imposter syndrome and apply and ask these questions in the interview! See the Jo... | 16 |
programminghorror | captnkrunch | hialkok | <|sols|><|sot|>Well somehow that fixes it, so it stays<|eot|><|sol|>https://i.redd.it/ury3vrh5uzv71.jpg<|eol|><|sor|>I just....I...it's hard to stay motivated in this field<|eor|><|sor|>Find you a team that lets you maintain code. Flip off imposter syndrome and apply and ask these questions in the interview! See the Jo... | 16 |
programminghorror | phoenix616 | 77tg9z | <|sols|><|sot|>Well that's odd<|eot|><|sol|>https://i.imgur.com/k6zfz4O.png<|eol|><|eols|><|endoftext|> | 1,544 |
programminghorror | bionicjoey | dooj0ha | <|sols|><|sot|>Well that's odd<|eot|><|sol|>https://i.imgur.com/k6zfz4O.png<|eol|><|sor|>I was joking with a friend about elegant yet shitty code once and came up with this:
https://i.imgur.com/0N4BLJK.png<|eor|><|eols|><|endoftext|> | 454 |
programminghorror | Thecrawsome | doojhwr | <|sols|><|sot|>Well that's odd<|eot|><|sol|>https://i.imgur.com/k6zfz4O.png<|eol|><|sor|>I was joking with a friend about elegant yet shitty code once and came up with this:
https://i.imgur.com/0N4BLJK.png<|eor|><|sor|>Thank god for modulo<|eor|><|eols|><|endoftext|> | 159 |
programminghorror | cypressious | doonkxy | <|sols|><|sot|>Well that's odd<|eot|><|sol|>https://i.imgur.com/k6zfz4O.png<|eol|><|sor|>Bonus points for the useless assignment in `isOdd(num+=2)`<|eor|><|eols|><|endoftext|> | 145 |
programminghorror | PersianMG | dophymz | <|sols|><|sot|>Well that's odd<|eot|><|sol|>https://i.imgur.com/k6zfz4O.png<|eol|><|sor|>I was joking with a friend about elegant yet shitty code once and came up with this:
https://i.imgur.com/0N4BLJK.png<|eor|><|sor|>Thank god for modulo<|eor|><|sor|>No need.
return x/2 == math.floor(x/2)<|eor|><|sor|>*Not sure... | 115 |
programminghorror | Alekzcb | doongke | <|sols|><|sot|>Well that's odd<|eot|><|sol|>https://i.imgur.com/k6zfz4O.png<|eol|><|sor|>I was joking with a friend about elegant yet shitty code once and came up with this:
https://i.imgur.com/0N4BLJK.png<|eor|><|sor|>Youre skipping a lot of numbers with that `x-2`. For completions sake, use
isOdd 0 = False
... | 77 |
programminghorror | suspiciously_calm | dop7szb | <|sols|><|sot|>Well that's odd<|eot|><|sol|>https://i.imgur.com/k6zfz4O.png<|eol|><|sor|>I was joking with a friend about elegant yet shitty code once and came up with this:
https://i.imgur.com/0N4BLJK.png<|eor|><|sor|>Thank god for modulo<|eor|><|sor|>No need.
return x/2 == math.floor(x/2)<|eor|><|sor|>*Not sure... | 71 |
programminghorror | 794613825 | dop0lgw | <|sols|><|sot|>Well that's odd<|eot|><|sol|>https://i.imgur.com/k6zfz4O.png<|eol|><|sor|>I was joking with a friend about elegant yet shitty code once and came up with this:
https://i.imgur.com/0N4BLJK.png<|eor|><|sor|>Thank god for modulo<|eor|><|sor|>No need.
return x/2 == math.floor(x/2)<|eor|><|eols|><|endoft... | 66 |
programminghorror | iamsooldithurts | doomoyl | <|sols|><|sot|>Well that's odd<|eot|><|sol|>https://i.imgur.com/k6zfz4O.png<|eol|><|sor|>I think when I was a kid I implemented stuff like this in VB or something by dividing by two and then multiplying the result by two to see if I got the same number. Also bad, but not nearly as bad.<|eor|><|sor|>That's downright res... | 59 |
programminghorror | ithika | dooiygp | <|sols|><|sot|>Well that's odd<|eot|><|sol|>https://i.imgur.com/k6zfz4O.png<|eol|><|sor|>I've been laughing for several minutes now. This is glorious. <|eor|><|eols|><|endoftext|> | 45 |
programminghorror | AnEmuCat | dookz3v | <|sols|><|sot|>Well that's odd<|eot|><|sol|>https://i.imgur.com/k6zfz4O.png<|eol|><|sor|>I think when I was a kid I implemented stuff like this in VB or something by dividing by two and then multiplying the result by two to see if I got the same number. Also bad, but not nearly as bad.<|eor|><|eols|><|endoftext|> | 43 |
programminghorror | iamsooldithurts | dooypyt | <|sols|><|sot|>Well that's odd<|eot|><|sol|>https://i.imgur.com/k6zfz4O.png<|eol|><|sor|> Where the hell do you people find this stuff?!<|eor|><|soopr|>IRC channels with some coding beginners in it.<|eoopr|><|sor|>"Beginners"? Whoever wrote that makes my student intern look like a genius.<|eor|><|eols|><|endoftext|> | 41 |
programminghorror | BCMM | doozdh7 | <|sols|><|sot|>Well that's odd<|eot|><|sol|>https://i.imgur.com/k6zfz4O.png<|eol|><|sor|>You see, this is why "if it looks stupid, but it works, it isn't stupid" is stupid.<|eor|><|eols|><|endoftext|> | 35 |
programminghorror | ajb32 | dotoc11 | <|sols|><|sot|>Well that's odd<|eot|><|sol|>https://i.imgur.com/k6zfz4O.png<|eol|><|sor|>I was joking with a friend about elegant yet shitty code once and came up with this:
https://i.imgur.com/0N4BLJK.png<|eor|><|sor|>Thank god for modulo<|eor|><|sor|>No need.
return x/2 == math.floor(x/2)<|eor|><|sor|>*Not sure... | 34 |
programminghorror | mszegedy | dopal54 | <|sols|><|sot|>Well that's odd<|eot|><|sol|>https://i.imgur.com/k6zfz4O.png<|eol|><|sor|>I was joking with a friend about elegant yet shitty code once and came up with this:
https://i.imgur.com/0N4BLJK.png<|eor|><|sor|>Thank god for modulo<|eor|><|sor|>No need.
return x/2 == math.floor(x/2)<|eor|><|sor|>*Not sure... | 34 |
programminghorror | iamsooldithurts | doomqx7 | <|sols|><|sot|>Well that's odd<|eot|><|sol|>https://i.imgur.com/k6zfz4O.png<|eol|><|sor|> Where the hell do you people find this stuff?!<|eor|><|eols|><|endoftext|> | 33 |
programminghorror | jana007 | dooix5n | <|sols|><|sot|>Well that's odd<|eot|><|sol|>https://i.imgur.com/k6zfz4O.png<|eol|><|sor|>[deleted]<|eor|><|sor|>I assume this was purposely terrible?<|eor|><|eols|><|endoftext|> | 32 |
programminghorror | fun840 | orox9d | <|sols|><|sot|>Found in a real project<|eot|><|sol|>https://i.redd.it/amfrhsr5qgd71.png<|eol|><|eols|><|endoftext|> | 1,538 |
programminghorror | Isvara | h6jiwir | <|sols|><|sot|>Found in a real project<|eot|><|sol|>https://i.redd.it/amfrhsr5qgd71.png<|eol|><|sor|>When procedural abstraction goes too far...<|eor|><|sor|>Not far enough!
if is_satisfied(username, len, lambda n: n < 4):
with
def is_satisfied(x, f, g):
return g(f(x))<|eor|><|eols|><|endoftext|> | 422 |
programminghorror | JuhaJGam3R | h6jizsx | <|sols|><|sot|>Found in a real project<|eot|><|sol|>https://i.redd.it/amfrhsr5qgd71.png<|eol|><|sor|>I bet there's a unit test here and it's literally `username.length() < 4` in the test.<|eor|><|eols|><|endoftext|> | 160 |
programminghorror | earthbound2eric | h6jgbrg | <|sols|><|sot|>Found in a real project<|eot|><|sol|>https://i.redd.it/amfrhsr5qgd71.png<|eol|><|sor|>Is this just
If (str.length() <4)?<|eor|><|eols|><|endoftext|> | 160 |
programminghorror | ZedTT | h6jgyrd | <|sols|><|sot|>Found in a real project<|eot|><|sol|>https://i.redd.it/amfrhsr5qgd71.png<|eol|><|sor|>Is this just
If (str.length() <4)?<|eor|><|sor|>It's python so
if len(username) < 4:
pass # do something<|eor|><|eols|><|endoftext|> | 156 |
programminghorror | goodudetheboy | h6jivmc | <|sols|><|sot|>Found in a real project<|eot|><|sol|>https://i.redd.it/amfrhsr5qgd71.png<|eol|><|sor|>All about that readability, amirite<|eor|><|eols|><|endoftext|> | 139 |
programminghorror | betterBytheBeach | h6jgrk5 | <|sols|><|sot|>Found in a real project<|eot|><|sol|>https://i.redd.it/amfrhsr5qgd71.png<|eol|><|sor|>Is this just
If (str.length() <4)?<|eor|><|sor|>Why do that when you can import a library that has a method to do that for you /s.<|eor|><|eols|><|endoftext|> | 101 |
programminghorror | PenisButtuh | h6jj36m | <|sols|><|sot|>Found in a real project<|eot|><|sol|>https://i.redd.it/amfrhsr5qgd71.png<|eol|><|sor|>Is this just
If (str.length() <4)?<|eor|><|sor|>Why do that when you can import a library that has a method to do that for you /s.<|eor|><|sor|>And then compare that boolean result to a boolean!<|eor|><|eols|><|endof... | 62 |
programminghorror | Famous_Profile | h6kiedo | <|sols|><|sot|>Found in a real project<|eot|><|sol|>https://i.redd.it/amfrhsr5qgd71.png<|eol|><|sor|>When procedural abstraction goes too far...<|eor|><|sor|>Not far enough!
if is_satisfied(username, len, lambda n: n < 4):
with
def is_satisfied(x, f, g):
return g(f(x))<|eor|><|sor|>I feel sick<|eor|>... | 56 |
programminghorror | noop_noob | h6js895 | <|sols|><|sot|>Found in a real project<|eot|><|sol|>https://i.redd.it/amfrhsr5qgd71.png<|eol|><|sor|>When procedural abstraction goes too far...<|eor|><|sor|>Not far enough!
if is_satisfied(username, len, lambda n: n < 4):
with
def is_satisfied(x, f, g):
return g(f(x))<|eor|><|sor|>Overly complicated... | 55 |
programminghorror | rpc123 | h6jq4te | <|sols|><|sot|>Found in a real project<|eot|><|sol|>https://i.redd.it/amfrhsr5qgd71.png<|eol|><|sor|>When procedural abstraction goes too far...<|eor|><|sor|>Not far enough!
if is_satisfied(username, len, lambda n: n < 4):
with
def is_satisfied(x, f, g):
return g(f(x))<|eor|><|sor|>I love this but I ... | 50 |
programminghorror | earthbound2eric | h6jh20d | <|sols|><|sot|>Found in a real project<|eot|><|sol|>https://i.redd.it/amfrhsr5qgd71.png<|eol|><|sor|>Is this just
If (str.length() <4)?<|eor|><|sor|>It's python so
if len(username) < 4:
pass # do something<|eor|><|sor|>That explains it. I've not written much Python.<|eor|><|eols|><|endoftext|> | 41 |
programminghorror | yhgfvtfhbv | h6jh38h | <|sols|><|sot|>Found in a real project<|eot|><|sol|>https://i.redd.it/amfrhsr5qgd71.png<|eol|><|sor|>Is this just
If (str.length() <4)?<|eor|><|sor|>wait you guys dont add useless abstraction to your programs?<|eor|><|eols|><|endoftext|> | 40 |
programminghorror | Oneiros18 | h6ke15g | <|sols|><|sot|>Found in a real project<|eot|><|sol|>https://i.redd.it/amfrhsr5qgd71.png<|eol|><|sor|>I bet there's a unit test here and it's literally `username.length() < 4` in the test.<|eor|><|sor|>`if len(username) < 4:`
`blablabla`<|eor|><|eols|><|endoftext|> | 36 |
programminghorror | p_turbo | h6jrrcb | <|sols|><|sot|>Found in a real project<|eot|><|sol|>https://i.redd.it/amfrhsr5qgd71.png<|eol|><|sor|>import under\_four\_character\_long from "checkIfFourChars";
import under\_six\_character\_long from "checkIfSixChars";<|eor|><|sor|>Just "Tell me you're being paid per lines of code without telling me you're being pai... | 36 |
programminghorror | redct | h6k2shy | <|sols|><|sot|>Found in a real project<|eot|><|sol|>https://i.redd.it/amfrhsr5qgd71.png<|eol|><|sor|>Ok now show me what's actually in that function.<|eor|><|sor|> return True<|eor|><|eols|><|endoftext|> | 35 |
programminghorror | tateisukannanirase | h6jjtdh | <|sols|><|sot|>Found in a real project<|eot|><|sol|>https://i.redd.it/amfrhsr5qgd71.png<|eol|><|sor|>Yep, it's horror. If he'd used javascript, he could install this from NPM!<|eor|><|eols|><|endoftext|> | 32 |
programminghorror | dna_beggar | h6jv657 | <|sols|><|sot|>Found in a real project<|eot|><|sol|>https://i.redd.it/amfrhsr5qgd71.png<|eol|><|sor|>It gives them the flexibility to modify the implementation of the function and write unit tests.
Probably a remote procedure call to the security service.
Edit: Plus, they have their bases covered if someone redefines... | 32 |
programminghorror | sastdast | cn6xcr | <|sols|><|sot|>Thanks. Now let me die.<|eot|><|sol|>https://i.redd.it/ui6m3u7pk1f31.jpg<|eol|><|eols|><|endoftext|> | 1,535 |
programminghorror | Bobbar84 | ew7rb1j | <|sols|><|sot|>Thanks. Now let me die.<|eot|><|sol|>https://i.redd.it/ui6m3u7pk1f31.jpg<|eol|><|sor|>The 3rd kind:
x >> 1<|eor|><|eols|><|endoftext|> | 352 |
programminghorror | ericl666 | ew7y5kx | <|sols|><|sot|>Thanks. Now let me die.<|eot|><|sol|>https://i.redd.it/ui6m3u7pk1f31.jpg<|eol|><|sor|>The 3rd kind:
x >> 1<|eor|><|sor|>Yep. I felt like I learned some mystical secret when I found out that shift one bit right divides by 2 and shift one bit left multiplies by 2.<|eor|><|eols|><|endoftext|> | 142 |
programminghorror | ProgrammerBro | ew7hnx2 | <|sols|><|sot|>Thanks. Now let me die.<|eot|><|sol|>https://i.redd.it/ui6m3u7pk1f31.jpg<|eol|><|sor|>Math.random() \* x converges to the same value eventually, probably.<|eor|><|eols|><|endoftext|> | 119 |
programminghorror | dbgprint | ew7m168 | <|sols|><|sot|>Thanks. Now let me die.<|eot|><|sol|>https://i.redd.it/ui6m3u7pk1f31.jpg<|eol|><|sor|>Isn't the first one more efficient? Multiplication should be faster than division<|eor|><|sor|>Most compilers will actually change division to multiplication for you if you divide by a constant value<|eor|><|eols|><|end... | 81 |
programminghorror | trwolfe13 | ewatoei | <|sols|><|sot|>Thanks. Now let me die.<|eot|><|sol|>https://i.redd.it/ui6m3u7pk1f31.jpg<|eol|><|sor|>The 3rd kind:
x >> 1<|eor|><|sor|>Yep. I felt like I learned some mystical secret when I found out that shift one bit right divides by 2 and shift one bit left multiplies by 2.<|eor|><|sor|>[deleted]<|eor|><|sor|>But h... | 67 |
programminghorror | FUZxxl | ew7zmeu | <|sols|><|sot|>Thanks. Now let me die.<|eot|><|sol|>https://i.redd.it/ui6m3u7pk1f31.jpg<|eol|><|sor|>The 3rd kind:
x >> 1<|eor|><|sor|>Yep. I felt like I learned some mystical secret when I found out that shift one bit right divides by 2 and shift one bit left multiplies by 2.<|eor|><|sor|>Excpet the rounding is wrong... | 54 |
programminghorror | Durahk | ew8qrwj | <|sols|><|sot|>Thanks. Now let me die.<|eot|><|sol|>https://i.redd.it/ui6m3u7pk1f31.jpg<|eol|><|sor|>The 3rd kind:
x >> 1<|eor|><|sor|>They're dividing floats. That only works with ints.<|eor|><|sor|>No biggie:
#include <stdio.h>
#include <stdint.h>
typedef struct {
uint32_t mant : 23;
ui... | 49 |
programminghorror | ipii | ew87h78 | <|sols|><|sot|>Thanks. Now let me die.<|eot|><|sol|>https://i.redd.it/ui6m3u7pk1f31.jpg<|eol|><|sor|>Isn't the first one more efficient? Multiplication should be faster than division<|eor|><|sor|>Most compilers will actually change division to multiplication for you if you divide by a constant value<|eor|><|sor|>This i... | 44 |
programminghorror | Workaphobia | ew8q0vn | <|sols|><|sot|>Thanks. Now let me die.<|eot|><|sol|>https://i.redd.it/ui6m3u7pk1f31.jpg<|eol|><|sor|>I'd say this belongs on /r/ProgrammingHumor except it's actually funny.<|eor|><|eols|><|endoftext|> | 43 |
programminghorror | FUZxxl | ew83s3n | <|sols|><|sot|>Thanks. Now let me die.<|eot|><|sol|>https://i.redd.it/ui6m3u7pk1f31.jpg<|eol|><|sor|>The 3rd kind:
x >> 1<|eor|><|sor|>Yep. I felt like I learned some mystical secret when I found out that shift one bit right divides by 2 and shift one bit left multiplies by 2.<|eor|><|sor|>Excpet the rounding is wrong... | 42 |
programminghorror | Casiell89 | ew7f7g0 | <|sols|><|sot|>Thanks. Now let me die.<|eot|><|sol|>https://i.redd.it/ui6m3u7pk1f31.jpg<|eol|><|sor|>Isn't the first one more efficient? Multiplication should be faster than division<|eor|><|eols|><|endoftext|> | 40 |
programminghorror | campbellm | ew8qqux | <|sols|><|sot|>Thanks. Now let me die.<|eot|><|sol|>https://i.redd.it/ui6m3u7pk1f31.jpg<|eol|><|sor|>The 3rd kind:
x >> 1<|eor|><|sor|>Yep. I felt like I learned some mystical secret when I found out that shift one bit right divides by 2 and shift one bit left multiplies by 2.<|eor|><|sor|>Isn't that the sort of weird... | 37 |
programminghorror | archpawn | ew8mzh9 | <|sols|><|sot|>Thanks. Now let me die.<|eot|><|sol|>https://i.redd.it/ui6m3u7pk1f31.jpg<|eol|><|sor|>The 3rd kind:
x >> 1<|eor|><|sor|>They're dividing floats. That only works with ints.<|eor|><|eols|><|endoftext|> | 34 |
programminghorror | SV-97 | ew7g9we | <|sols|><|sot|>Thanks. Now let me die.<|eot|><|sol|>https://i.redd.it/ui6m3u7pk1f31.jpg<|eol|><|sor|>Isn't the first one more efficient? Multiplication should be faster than division<|eor|><|sor|>Yeah and 0.5 is less than 2.0 so it needs less memory<|eor|><|eols|><|endoftext|> | 31 |
programminghorror | atimholt | ew8t0kl | <|sols|><|sot|>Thanks. Now let me die.<|eot|><|sol|>https://i.redd.it/ui6m3u7pk1f31.jpg<|eol|><|sor|>Math.random() \* x converges to the same value eventually, probably.<|eor|><|sor|>A sufficiently random walk inside a finite domain always eventually gives you the answer you want. Choose your random number generator we... | 29 |
programminghorror | sarkie | ewap7op | <|sols|><|sot|>Thanks. Now let me die.<|eot|><|sol|>https://i.redd.it/ui6m3u7pk1f31.jpg<|eol|><|sor|>The 3rd kind:
x >> 1<|eor|><|sor|>Yep. I felt like I learned some mystical secret when I found out that shift one bit right divides by 2 and shift one bit left multiplies by 2.<|eor|><|sor|>[deleted]<|eor|><|sor|>[than... | 29 |
programminghorror | campbellm | ew8qvqj | <|sols|><|sot|>Thanks. Now let me die.<|eot|><|sol|>https://i.redd.it/ui6m3u7pk1f31.jpg<|eol|><|sor|>Isn't the first one more efficient? Multiplication should be faster than division<|eor|><|sor|>Yeah and 0.5 is less than 2.0 so it needs less memory<|eor|><|sor|>Same reason I use 8 point fonts to save disk space when s... | 27 |
programminghorror | citewiki | ewcqapy | <|sols|><|sot|>Thanks. Now let me die.<|eot|><|sol|>https://i.redd.it/ui6m3u7pk1f31.jpg<|eol|><|sor|>The 3rd kind:
x >> 1<|eor|><|sor|>Yep. I felt like I learned some mystical secret when I found out that shift one bit right divides by 2 and shift one bit left multiplies by 2.<|eor|><|sor|>[deleted]<|eor|><|sor|>But h... | 23 |
programminghorror | zerj | ew8umpa | <|sols|><|sot|>Thanks. Now let me die.<|eot|><|sol|>https://i.redd.it/ui6m3u7pk1f31.jpg<|eol|><|sor|>Isn't the first one more efficient? Multiplication should be faster than division<|eor|><|sor|>Most compilers will actually change division to multiplication for you if you divide by a constant value<|eor|><|sor|>This i... | 23 |
programminghorror | PeronTheDuck | ca34bw | <|sols|><|sot|>When your code still doesn't want to work, but it can't find any more errors to complain<|eot|><|sol|>https://i.redd.it/s8d0ju7cat831.png<|eol|><|eols|><|endoftext|> | 1,538 |
programminghorror | farsightxr20 | et5jkkg | <|sols|><|sot|>When your code still doesn't want to work, but it can't find any more errors to complain<|eot|><|sol|>https://i.redd.it/s8d0ju7cat831.png<|eol|><|sor|>You didn't write it in green color, that's why<|eor|><|sor|>OP wrote "read" (past tense declarative) whereas they should have written "read" (present tens... | 394 |
programminghorror | lukajda33 | et5iw6s | <|sols|><|sot|>When your code still doesn't want to work, but it can't find any more errors to complain<|eot|><|sol|>https://i.redd.it/s8d0ju7cat831.png<|eol|><|sor|>You didn't write it in green color, that's why<|eor|><|eols|><|endoftext|> | 382 |
programminghorror | ZylonBane | et5iu0p | <|sols|><|sot|>When your code still doesn't want to work, but it can't find any more errors to complain<|eot|><|sol|>https://i.redd.it/s8d0ju7cat831.png<|eol|><|sor|>ERROR: NO ERRORS FOUND<|eor|><|eols|><|endoftext|> | 159 |
programminghorror | AtLeastOneAlias | et5ic5f | <|sols|><|sot|>When your code still doesn't want to work, but it can't find any more errors to complain<|eot|><|sol|>https://i.redd.it/s8d0ju7cat831.png<|eol|><|sor|>Frank, stop youre scaring the children<|eor|><|eols|><|endoftext|> | 70 |
programminghorror | hsxp | et6b5pi | <|sols|><|sot|>When your code still doesn't want to work, but it can't find any more errors to complain<|eot|><|sol|>https://i.redd.it/s8d0ju7cat831.png<|eol|><|sor|>If I ever have an error my debug process starts with cutting and pasting the line. It works a depressing amount of the time.<|eor|><|sor|>Those are the st... | 70 |
programminghorror | ShetlandJames | et5q5kh | <|sols|><|sot|>When your code still doesn't want to work, but it can't find any more errors to complain<|eot|><|sol|>https://i.redd.it/s8d0ju7cat831.png<|eol|><|sor|>You didn't write it in green color, that's why<|eor|><|sor|>OP wrote "read" (past tense declarative) whereas they should have written "read" (present tens... | 67 |
programminghorror | greycubed | et5lnir | <|sols|><|sot|>When your code still doesn't want to work, but it can't find any more errors to complain<|eot|><|sol|>https://i.redd.it/s8d0ju7cat831.png<|eol|><|sor|>Why are you cyberbullying me.<|eor|><|eols|><|endoftext|> | 59 |
programminghorror | the-computer-guy | et5urnp | <|sols|><|sot|>When your code still doesn't want to work, but it can't find any more errors to complain<|eot|><|sol|>https://i.redd.it/s8d0ju7cat831.png<|eol|><|sor|>This can happen if you accidentally type a nonbreaking space or some other invisible character.<|eor|><|eols|><|endoftext|> | 44 |
programminghorror | zelmarvalarion | et5x8ic | <|sols|><|sot|>When your code still doesn't want to work, but it can't find any more errors to complain<|eot|><|sol|>https://i.redd.it/s8d0ju7cat831.png<|eol|><|sor|>This can happen if you accidentally type a nonbreaking space or some other invisible character.<|eor|><|sor|>Yeah, my first though was a zero-width space,... | 34 |
programminghorror | grammatiker | et6celv | <|sols|><|sot|>When your code still doesn't want to work, but it can't find any more errors to complain<|eot|><|sol|>https://i.redd.it/s8d0ju7cat831.png<|eol|><|sor|>If I ever have an error my debug process starts with cutting and pasting the line. It works a depressing amount of the time.<|eor|><|sor|>Those are the st... | 31 |
programminghorror | karbonkel1 | et69lom | <|sols|><|sot|>When your code still doesn't want to work, but it can't find any more errors to complain<|eot|><|sol|>https://i.redd.it/s8d0ju7cat831.png<|eol|><|sor|>You didn't write it in green color, that's why<|eor|><|sor|>OP wrote "read" (past tense declarative) whereas they should have written "read" (present tens... | 26 |
programminghorror | Return_Of_The_Fly | et5sqsb | <|sols|><|sot|>When your code still doesn't want to work, but it can't find any more errors to complain<|eot|><|sol|>https://i.redd.it/s8d0ju7cat831.png<|eol|><|sor|>First one is present tense, second one is past tense. Duh!<|eor|><|eols|><|endoftext|> | 20 |
programminghorror | konstantinua00 | et9gip9 | <|sols|><|sot|>When your code still doesn't want to work, but it can't find any more errors to complain<|eot|><|sol|>https://i.redd.it/s8d0ju7cat831.png<|eol|><|sor|>ERROR: NO ERRORS FOUND<|eor|><|sor|>Task failed successfully<|eor|><|eols|><|endoftext|> | 15 |
programminghorror | Coded__Ragon | et62t5x | <|sols|><|sot|>When your code still doesn't want to work, but it can't find any more errors to complain<|eot|><|sol|>https://i.redd.it/s8d0ju7cat831.png<|eol|><|sor|>Can you tell me what programming language this is from... I'm asking for a friend...<|eor|><|eols|><|endoftext|> | 8 |
programminghorror | unfixpoint | et6t2p1 | <|sols|><|sot|>When your code still doesn't want to work, but it can't find any more errors to complain<|eot|><|sol|>https://i.redd.it/s8d0ju7cat831.png<|eol|><|sor|>In pretty much any language I know `"rad" != "read"` \^\^<|eor|><|eols|><|endoftext|> | 6 |
programminghorror | winter_mutant | et7e2lm | <|sols|><|sot|>When your code still doesn't want to work, but it can't find any more errors to complain<|eot|><|sol|>https://i.redd.it/s8d0ju7cat831.png<|eol|><|sor|>[deleted]<|eor|><|sor|>Yeah this is some unicode fuckery. There could be a BOM or a control character or fuck knows what else in there<|eor|><|eols|><|end... | 6 |
programminghorror | applefanboy1234 | et6zlw1 | <|sols|><|sot|>When your code still doesn't want to work, but it can't find any more errors to complain<|eot|><|sol|>https://i.redd.it/s8d0ju7cat831.png<|eol|><|sor|>You didn't write it in green color, that's why<|eor|><|sor|>OP wrote "read" (past tense declarative) whereas they should have written "read" (present tens... | 5 |
programminghorror | Flesh_Bag | myj0hj | <|sols|><|sot|>A horrific suggestion from the linter..<|eot|><|sol|>https://v.redd.it/246cyino8ev61<|eol|><|eols|><|endoftext|> | 1,538 |
programminghorror | FrenchieM | gvvdbxr | <|sols|><|sot|>A horrific suggestion from the linter..<|eot|><|sol|>https://v.redd.it/246cyino8ev61<|eol|><|sor|>DESTRUCT<|eor|><|eols|><|endoftext|> | 189 |
programminghorror | Thriven | gvv9jfl | <|sols|><|sot|>A horrific suggestion from the linter..<|eot|><|sol|>https://v.redd.it/246cyino8ev61<|eol|><|sor|>"it's indented perfectly though"
- Python somebody<|eor|><|eols|><|endoftext|> | 173 |
programminghorror | n0tKamui | gvvd366 | <|sols|><|sot|>A horrific suggestion from the linter..<|eot|><|sol|>https://v.redd.it/246cyino8ev61<|eol|><|sor|>what's this programming language?<|eor|><|sor|>it's OCaml, one of the best functionnal languages<|eor|><|eols|><|endoftext|> | 96 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.