subreddit
stringclasses
7 values
author
stringlengths
3
20
id
stringlengths
5
7
content
stringlengths
67
30.4k
score
int64
0
140k
programminghorror
iEatPlankton
gd23rie
<|sols|><|sot|>Why?<|eot|><|sol|>https://i.redd.it/4kr1md1k7l061.jpg<|eol|><|sor|>Here, you dropped this: { }<|eor|><|eols|><|endoftext|>
28
programminghorror
rajesh_dude0
lgsd18
<|sols|><|sot|>I present: SleepSort<|eot|><|sol|>https://i.redd.it/czwjt4cxumg61.jpg<|eol|><|eols|><|endoftext|>
4,134
programminghorror
IsAlwaysHungry
gmt956c
<|sols|><|sot|>I present: SleepSort<|eot|><|sol|>https://i.redd.it/czwjt4cxumg61.jpg<|eol|><|sor|>Complexity o(n) Memory usage o(n) This is a perfect sort algorithm. /s<|eor|><|eols|><|endoftext|>
675
programminghorror
Beautah
gmt6r8p
<|sols|><|sot|>I present: SleepSort<|eot|><|sol|>https://i.redd.it/czwjt4cxumg61.jpg<|eol|><|sor|>I'm kind of impressed a person could think of this<|eor|><|eols|><|endoftext|>
351
programminghorror
raaneholmg
gmteir7
<|sols|><|sot|>I present: SleepSort<|eot|><|sol|>https://i.redd.it/czwjt4cxumg61.jpg<|eol|><|sor|>In case anyone's wondering, no it does not work in most real-life use cases. Larger arrays or arrays containing negatives will sort incorrectly.<|eor|><|sor|>No, the negative numbers will simply cause the print to be exec...
301
programminghorror
lifeRunsOnCod3
gmtjfcj
<|sols|><|sot|>I present: SleepSort<|eot|><|sol|>https://i.redd.it/czwjt4cxumg61.jpg<|eol|><|sor|>Complexity o(n) Memory usage o(n) This is a perfect sort algorithm. /s<|eor|><|sor|>"Time" Complexity LOL<|eor|><|eols|><|endoftext|>
250
programminghorror
BLucky_RD
gmtumlu
<|sols|><|sot|>I present: SleepSort<|eot|><|sol|>https://i.redd.it/czwjt4cxumg61.jpg<|eol|><|sor|>Complexity o(n) Memory usage o(n) This is a perfect sort algorithm. /s<|eor|><|sor|>Complexity: O(h no)<|eor|><|eols|><|endoftext|>
239
programminghorror
Djokito
gmt6lo9
<|sols|><|sot|>I present: SleepSort<|eot|><|sol|>https://i.redd.it/czwjt4cxumg61.jpg<|eol|><|sor|>It's both smartish and absolutely awful, thanks!<|eor|><|eols|><|endoftext|>
209
programminghorror
riga_mortus
gmthnmc
<|sols|><|sot|>I present: SleepSort<|eot|><|sol|>https://i.redd.it/czwjt4cxumg61.jpg<|eol|><|sor|>In case anyone's wondering, no it does not work in most real-life use cases. Larger arrays or arrays containing negatives will sort incorrectly.<|eor|><|sor|>No, the negative numbers will simply cause the print to be exec...
171
programminghorror
RiderHood
gmtbtrx
<|sols|><|sot|>I present: SleepSort<|eot|><|sol|>https://i.redd.it/czwjt4cxumg61.jpg<|eol|><|sor|>If you already know the min and max. Transform each element by (x-min)/(max-min). Each sort now takes exactly one second.<|eor|><|eols|><|endoftext|>
148
programminghorror
riga_mortus
gmt8inf
<|sols|><|sot|>I present: SleepSort<|eot|><|sol|>https://i.redd.it/czwjt4cxumg61.jpg<|eol|><|sor|>In case anyone's wondering, no it does not work in most real-life use cases. Larger arrays or arrays containing negatives will sort incorrectly.<|eor|><|eols|><|endoftext|>
111
programminghorror
MechanicalHorse
gmtwxhk
<|sols|><|sot|>I present: SleepSort<|eot|><|sol|>https://i.redd.it/czwjt4cxumg61.jpg<|eol|><|sor|>In case anyone's wondering, no it does not work in most real-life use cases. Larger arrays or arrays containing negatives will sort incorrectly.<|eor|><|sor|>No, the negative numbers will simply cause the print to be exec...
92
programminghorror
ray10k
gmtdwg3
<|sols|><|sot|>I present: SleepSort<|eot|><|sol|>https://i.redd.it/czwjt4cxumg61.jpg<|eol|><|sor|>If you already know the min and max. Transform each element by (x-min)/(max-min). Each sort now takes exactly one second.<|eor|><|sor|>Until you start running into floating point precision issues, of course<|eor|><|eols|><...
81
programminghorror
Needleroozer
gmwi558
<|sols|><|sot|>I present: SleepSort<|eot|><|sol|>https://i.redd.it/czwjt4cxumg61.jpg<|eol|><|sor|>I'm kind of impressed a person could think of this<|eor|><|sor|>If I asked them to code a sort and they came up with this, I'd hire them.<|eor|><|eols|><|endoftext|>
79
programminghorror
stone_henge
gmtohns
<|sols|><|sot|>I present: SleepSort<|eot|><|sol|>https://i.redd.it/czwjt4cxumg61.jpg<|eol|><|sor|>Complexity o(n) Memory usage o(n) This is a perfect sort algorithm. /s<|eor|><|sor|>For anyone who doesn't understand why this is wrong: _n_ is the number of bits needed to describe the problem, but each bit you add to a ...
72
programminghorror
sharddblade
gmteco0
<|sols|><|sot|>I present: SleepSort<|eot|><|sol|>https://i.redd.it/czwjt4cxumg61.jpg<|eol|><|sor|>Noob here. Can someone explain how it works?<|eor|><|sor|>It iterates over an array of values. For each value, it registers a callback that logs the value after the value in milliseconds of time has passed. The values are ...
64
programminghorror
OneTrueKingOfOOO
gmtmaiw
<|sols|><|sot|>I present: SleepSort<|eot|><|sol|>https://i.redd.it/czwjt4cxumg61.jpg<|eol|><|sor|>Complexity o(n) Memory usage o(n) This is a perfect sort algorithm. /s<|eor|><|sor|>Sometimes the O matters more than the n<|eor|><|eols|><|endoftext|>
57
programminghorror
deathbutton1
gmts5hu
<|sols|><|sot|>I present: SleepSort<|eot|><|sol|>https://i.redd.it/czwjt4cxumg61.jpg<|eol|><|sor|>I prefer quantum bogosort. Bogosort is when you randomize the list until it is sorted. Quantum bogosort is when you quantumly randomize the list, and if the list is not sorted then destroy the universe (left as an exerci...
43
programminghorror
Tinamil
gmucwv0
<|sols|><|sot|>I present: SleepSort<|eot|><|sol|>https://i.redd.it/czwjt4cxumg61.jpg<|eol|><|sor|>Complexity o(n) Memory usage o(n) This is a perfect sort algorithm. /s<|eor|><|sor|>For anyone who doesn't understand why this is wrong: _n_ is the number of bits needed to describe the problem, but each bit you add to a ...
38
programminghorror
Ragingman2
gmu1fpt
<|sols|><|sot|>I present: SleepSort<|eot|><|sol|>https://i.redd.it/czwjt4cxumg61.jpg<|eol|><|sor|>Complexity o(n) Memory usage o(n) This is a perfect sort algorithm. /s<|eor|><|sor|>For anyone who doesn't understand why this is wrong: _n_ is the number of bits needed to describe the problem, but each bit you add to a ...
36
programminghorror
EntropySpark
gmwy840
<|sols|><|sot|>I present: SleepSort<|eot|><|sol|>https://i.redd.it/czwjt4cxumg61.jpg<|eol|><|sor|>I'm kind of impressed a person could think of this<|eor|><|sor|>If I asked them to code a sort and they came up with this, I'd hire them.<|eor|><|sor|>Hire them only if they can also explain why it isn't actually O(n), and...
36
programminghorror
danfay222
i1b3cf
<|sols|><|sot|>Is this test-driven development?<|eot|><|sol|>https://i.redd.it/0nkzjwhc48e51.jpg<|eol|><|eols|><|endoftext|>
4,012
programminghorror
Madoka_the_Goddess
fzw8w0i
<|sols|><|sot|>Is this test-driven development?<|eot|><|sol|>https://i.redd.it/0nkzjwhc48e51.jpg<|eol|><|sor|>Imagine if the unit test picked the number at random. They would still be adding `if` statements to this day...<|eor|><|eols|><|endoftext|>
541
programminghorror
Kitsuba
fzw3ii1
<|sols|><|sot|>Is this test-driven development?<|eot|><|sol|>https://i.redd.it/0nkzjwhc48e51.jpg<|eol|><|sor|>Worst implementation of test driven programming i've ever witnessed hahahaha<|eor|><|eols|><|endoftext|>
282
programminghorror
lgastako
fzww6tt
<|sols|><|sot|>Is this test-driven development?<|eot|><|sol|>https://i.redd.it/0nkzjwhc48e51.jpg<|eol|><|sor|>TDD: Ticket Driven Development.<|eor|><|eols|><|endoftext|>
251
programminghorror
Linguaphonia
fzw5nme
<|sols|><|sot|>Is this test-driven development?<|eot|><|sol|>https://i.redd.it/0nkzjwhc48e51.jpg<|eol|><|sor|>The ones for the tests are terrible but the ones for the tickets are top programming horror.<|eor|><|eols|><|endoftext|>
161
programminghorror
Linguaphonia
fzwa7f7
<|sols|><|sot|>Is this test-driven development?<|eot|><|sol|>https://i.redd.it/0nkzjwhc48e51.jpg<|eol|><|sor|>Imagine if the unit test picked the number at random. They would still be adding `if` statements to this day...<|eor|><|sor|>One day property based testing will make it's way into the mainstream.<|eor|><|eols|>...
152
programminghorror
monkeyinmysoup
fzx5ipg
<|sols|><|sot|>Is this test-driven development?<|eot|><|sol|>https://i.redd.it/0nkzjwhc48e51.jpg<|eol|><|sor|>ITT: people not understanding this is clearly a joke<|eor|><|eols|><|endoftext|>
137
programminghorror
Invertonix
fzvuxkw
<|sols|><|sot|>Is this test-driven development?<|eot|><|sol|>https://i.redd.it/0nkzjwhc48e51.jpg<|eol|><|sor|>LMAO. Just hardcode the tests and be done with it.<|eor|><|eols|><|endoftext|>
79
programminghorror
Needleroozer
fzxp6q6
<|sols|><|sot|>Is this test-driven development?<|eot|><|sol|>https://i.redd.it/0nkzjwhc48e51.jpg<|eol|><|sor|>TDD: Ticket Driven Development.<|eor|><|sor|>You laugh, but at my last job the bug tracker was used to introduce new features. The bug was closed when the feature was implemented.<|eor|><|eols|><|endoftext|>
58
programminghorror
ITriedLightningTendr
fzy0or9
<|sols|><|sot|>Is this test-driven development?<|eot|><|sol|>https://i.redd.it/0nkzjwhc48e51.jpg<|eol|><|sor|>TDD: Ticket Driven Development.<|eor|><|sor|>You laugh, but at my last job the bug tracker was used to introduce new features. The bug was closed when the feature was implemented.<|eor|><|sor|>I dunno, seems fi...
51
programminghorror
danfay222
fzwty20
<|sols|><|sot|>Is this test-driven development?<|eot|><|sol|>https://i.redd.it/0nkzjwhc48e51.jpg<|eol|><|sor|>Imagine if the unit test picked the number at random. They would still be adding `if` statements to this day...<|eor|><|sor|>But what would you use to test if the solution for the random number is correct? The ...
51
programminghorror
cereal_killer_69
fzwov1f
<|sols|><|sot|>Is this test-driven development?<|eot|><|sol|>https://i.redd.it/0nkzjwhc48e51.jpg<|eol|><|sor|>sometimes i do this for the rush of passing all tests and be motivated to actually fix the code<|eor|><|sor|>\* demotivated Honestly I recently got a new job and there are *no code reviews* and it's heaven! I'...
45
programminghorror
danfay222
fzwtmbx
<|sols|><|sot|>Is this test-driven development?<|eot|><|sol|>https://i.redd.it/0nkzjwhc48e51.jpg<|eol|><|sor|>Imagine if the unit test picked the number at random. They would still be adding `if` statements to this day...<|eor|><|sor|>But what would you use to test if the solution for the random number is correct? The ...
44
programminghorror
PlaneCrashers
fzwvja1
<|sols|><|sot|>Is this test-driven development?<|eot|><|sol|>https://i.redd.it/0nkzjwhc48e51.jpg<|eol|><|sor|>Imagine if the unit test picked the number at random. They would still be adding `if` statements to this day...<|eor|><|sor|>One day property based testing will make it's way into the mainstream.<|eor|><|sor|>N...
43
programminghorror
gipp
fzwgj0x
<|sols|><|sot|>Is this test-driven development?<|eot|><|sol|>https://i.redd.it/0nkzjwhc48e51.jpg<|eol|><|sor|>What is the point of having such horror in your code. Nothing usefull can be returned by this function/method. Most part of coding horrors use to return some usefull stuff, but this...<|eor|><|sor|>Not sure if ...
42
programminghorror
danfay222
fzwa4gm
<|sols|><|sot|>Is this test-driven development?<|eot|><|sol|>https://i.redd.it/0nkzjwhc48e51.jpg<|eol|><|sor|>What is the point of having such horror in your code. Nothing usefull can be returned by this function/method. Most part of coding horrors use to return some usefull stuff, but this...<|eor|><|soopr|>What do yo...
30
programminghorror
danfay222
fzx5txs
<|sols|><|sot|>Is this test-driven development?<|eot|><|sol|>https://i.redd.it/0nkzjwhc48e51.jpg<|eol|><|sor|>this can be a real approach called "evil pair programming" wherein your partner writes a test suite and you write a function that passes the tests even if the function itself is completely stupid. the idea is t...
29
programminghorror
nulldesign
fzyu4lu
<|sols|><|sot|>Is this test-driven development?<|eot|><|sol|>https://i.redd.it/0nkzjwhc48e51.jpg<|eol|><|sor|>TDD: Ticket Driven Development.<|eor|><|sor|>You laugh, but at my last job the bug tracker was used to introduce new features. The bug was closed when the feature was implemented.<|eor|><|sor|>This is a fairly ...
27
programminghorror
TheTechRobo
lzbj2i
<|sols|><|sot|>A Python programmer attempting Java<|eot|><|sol|>https://imgur.com/ljB2L7Q.jpg<|eol|><|eols|><|endoftext|>
4,005
programminghorror
real_mfg
gq1gpje
<|sols|><|sot|>A Python programmer attempting Java<|eot|><|sol|>https://imgur.com/ljB2L7Q.jpg<|eol|><|sor|>Add a few more tabs in there and it's almost as if the braces and semicolons don't exist<|eor|><|eols|><|endoftext|>
295
programminghorror
xigoi
gq1hg61
<|sols|><|sot|>A Python programmer attempting Java<|eot|><|sol|>https://imgur.com/ljB2L7Q.jpg<|eol|><|sor|>Hey, it was my turn to post this this week!<|eor|><|eols|><|endoftext|>
183
programminghorror
50dimensions
gq1kcok
<|sols|><|sot|>A Python programmer attempting Java<|eot|><|sol|>https://imgur.com/ljB2L7Q.jpg<|eol|><|sor|>Add a few more tabs in there and it's almost as if the braces and semicolons don't exist<|eor|><|sor|>Then it's just Lua<|eor|><|eols|><|endoftext|>
113
programminghorror
DullestWall
gq237qd
<|sols|><|sot|>A Python programmer attempting Java<|eot|><|sol|>https://imgur.com/ljB2L7Q.jpg<|eol|><|sor|>My first thought was "What's the problem? This looks fine". My second thought was "Wait, it said Java, how does this compile?" Then I moved my thumb and saw the horrors on the ends of the lines.<|eor|><|eols|><...
102
programminghorror
Toll1984
gq1knph
<|sols|><|sot|>A Python programmer attempting Java<|eot|><|sol|>https://imgur.com/ljB2L7Q.jpg<|eol|><|sor|>Mom can we have python? No we have python at home. Python at home:<|eor|><|sor|>Jython<|eor|><|eols|><|endoftext|>
99
programminghorror
fukitol-
gq1r19g
<|sols|><|sot|>A Python programmer attempting Java<|eot|><|sol|>https://imgur.com/ljB2L7Q.jpg<|eol|><|sor|>I don't understand why people don't like braces, they make it so much easier to see different code blocks<|eor|><|sor|>Python is perfectly legible without them, but I'm fine with them too. Whatever the hell this ...
96
programminghorror
mothzilla
gq1f3ze
<|sols|><|sot|>A Python programmer attempting Java<|eot|><|sol|>https://imgur.com/ljB2L7Q.jpg<|eol|><|sor|>There's a language where this is encouraged for some reason.<|eor|><|eols|><|endoftext|>
68
programminghorror
Liesmith424
gq1swtu
<|sols|><|sot|>A Python programmer attempting Java<|eot|><|sol|>https://imgur.com/ljB2L7Q.jpg<|eol|><|sor|>Add a few more tabs in there and it's almost as if the braces and semicolons don't exist<|eor|><|sor|>Semicolons aren't real; they can't hurt you.<|eor|><|eols|><|endoftext|>
62
programminghorror
Dionysusnu
gq38u6j
<|sols|><|sot|>A Python programmer attempting Java<|eot|><|sol|>https://imgur.com/ljB2L7Q.jpg<|eol|><|sor|>Add a few more tabs in there and it's almost as if the braces and semicolons don't exist<|eor|><|sor|>Then it's just Lua<|eor|><|sor|>end end end end end end end end end end end end<|eor|><|eols|><|endoftext|>
56
programminghorror
railfanespee
gq1fjsd
<|sols|><|sot|>A Python programmer attempting Java<|eot|><|sol|>https://imgur.com/ljB2L7Q.jpg<|eol|><|sor|>There's a language where this is encouraged for some reason.<|eor|><|sor|>Everyday we stray further from God's light.<|eor|><|eols|><|endoftext|>
51
programminghorror
Emperor-Valtorei
gq1n3vy
<|sols|><|sot|>A Python programmer attempting Java<|eot|><|sol|>https://imgur.com/ljB2L7Q.jpg<|eol|><|sor|>What in the god damn fuck<|eor|><|eols|><|endoftext|>
38
programminghorror
platypus_69
gq1kgp7
<|sols|><|sot|>A Python programmer attempting Java<|eot|><|sol|>https://imgur.com/ljB2L7Q.jpg<|eol|><|sor|>There's a language where this is encouraged for some reason.<|eor|><|sor|>Where is this language?<|eor|><|sor|>Idk, probably on earth<|eor|><|eols|><|endoftext|>
33
programminghorror
Fred-U
gq2fulq
<|sols|><|sot|>A Python programmer attempting Java<|eot|><|sol|>https://imgur.com/ljB2L7Q.jpg<|eol|><|sor|>Add a few more tabs in there and it's almost as if the braces and semicolons don't exist<|eor|><|sor|>Semicolons aren't real; they can't hurt you.<|eor|><|sor|>*sees semicolon in this sentence*; AAAAAAAAAAAHHH<|eo...
30
programminghorror
jugnuggets
gq2pea6
<|sols|><|sot|>A Python programmer attempting Java<|eot|><|sol|>https://imgur.com/ljB2L7Q.jpg<|eol|><|sor|>Mom can we have python? No we have python at home. Python at home:<|eor|><|sor|>Jython<|eor|><|sor|>Kill it with fire<|eor|><|eols|><|endoftext|>
27
programminghorror
Loading_M_
gq1q2lt
<|sols|><|sot|>A Python programmer attempting Java<|eot|><|sol|>https://imgur.com/ljB2L7Q.jpg<|eol|><|sor|>That's one of the reasons I absolutely despise Python. I can't deal with code without braces and semicolons, it's an affront to existence itself.<|eor|><|sor|>Fun fact, semicolons are optional in python. You can a...
23
programminghorror
plainrane
gq2lozk
<|sols|><|sot|>A Python programmer attempting Java<|eot|><|sol|>https://imgur.com/ljB2L7Q.jpg<|eol|><|sor|>I don't understand why people don't like braces, they make it so much easier to see different code blocks<|eor|><|sor|>Python is perfectly legible without them, but I'm fine with them too. Whatever the hell this ...
22
programminghorror
sambolias
gq1sdge
<|sols|><|sot|>A Python programmer attempting Java<|eot|><|sol|>https://imgur.com/ljB2L7Q.jpg<|eol|><|sor|>Mom can we have python? No we have python at home. Python at home:<|eor|><|sor|>Monty python<|eor|><|eols|><|endoftext|>
21
programminghorror
PhoenixPaladin
qqmj7r
<|sols|><|sot|>Gotta double check real quick<|eot|><|sol|>https://i.redd.it/nkv4sgtq8py71.png<|eol|><|eols|><|endoftext|>
3,983
programminghorror
Camcronicus
hk1dvg6
<|sols|><|sot|>Gotta double check real quick<|eot|><|sol|>https://i.redd.it/nkv4sgtq8py71.png<|eol|><|sor|>//protects against cosmic ray bit flipping<|eor|><|eols|><|endoftext|>
967
programminghorror
MykonCodes
hk1c5b3
<|sols|><|sot|>Gotta double check real quick<|eot|><|sol|>https://i.redd.it/nkv4sgtq8py71.png<|eol|><|sor|> That second else statement renders me questioning reality<|eor|><|eols|><|endoftext|>
836
programminghorror
pravin-singh
hk1k2et
<|sols|><|sot|>Gotta double check real quick<|eot|><|sol|>https://i.redd.it/nkv4sgtq8py71.png<|eol|><|sor|>So much checking and still the code will _always_ do `EXIT_FAILURE`<|eor|><|eols|><|endoftext|>
619
programminghorror
omgpliable
hk1buot
<|sols|><|sot|>Gotta double check real quick<|eot|><|sol|>https://i.redd.it/nkv4sgtq8py71.png<|eol|><|sor|>Wow that dude assigned the fuck out of that variable what a pimp<|eor|><|eols|><|endoftext|>
198
programminghorror
RouletteSensei
hk1exwh
<|sols|><|sot|>Gotta double check real quick<|eot|><|sol|>https://i.redd.it/nkv4sgtq8py71.png<|eol|><|sor|> That second else statement renders me questioning reality<|eor|><|sor|>*turns off simulation server*<|eor|><|eols|><|endoftext|>
175
programminghorror
Mr_Gobble_Gobble
hk1ezz4
<|sols|><|sot|>Gotta double check real quick<|eot|><|sol|>https://i.redd.it/nkv4sgtq8py71.png<|eol|><|sor|>I'll take 'Bullshit that people made up trying to get karma' for $100<|eor|><|eols|><|endoftext|>
159
programminghorror
kombajno
hk1dr90
<|sols|><|sot|>Gotta double check real quick<|eot|><|sol|>https://i.redd.it/nkv4sgtq8py71.png<|eol|><|sor|>Is that what thread safe means?<|eor|><|eols|><|endoftext|>
158
programminghorror
ilep
hk1i76d
<|sols|><|sot|>Gotta double check real quick<|eot|><|sol|>https://i.redd.it/nkv4sgtq8py71.png<|eol|><|sor|>//protects against cosmic ray bit flipping<|eor|><|sor|>Or simply someone does not understand thread synchronization and locking.. Is that perhaps globally shared variable?<|eor|><|eols|><|endoftext|>
158
programminghorror
PhoenixPaladin
hk1ml88
<|sols|><|sot|>Gotta double check real quick<|eot|><|sol|>https://i.redd.it/nkv4sgtq8py71.png<|eol|><|sor|>//protects against cosmic ray bit flipping<|eor|><|sor|>Or simply someone does not understand thread synchronization and locking.. Is that perhaps globally shared variable?<|eor|><|soopr|>Multithreading with a rac...
108
programminghorror
Just_Maintenance
hk1ktwk
<|sols|><|sot|>Gotta double check real quick<|eot|><|sol|>https://i.redd.it/nkv4sgtq8py71.png<|eol|><|sor|>noob, true pros do: while(1) { x = 100; }<|eor|><|eols|><|endoftext|>
98
programminghorror
j0hn4devils
hk1ky03
<|sols|><|sot|>Gotta double check real quick<|eot|><|sol|>https://i.redd.it/nkv4sgtq8py71.png<|eol|><|sor|>//protects against cosmic ray bit flipping<|eor|><|sor|>This guy must be an aerospace dev.<|eor|><|eols|><|endoftext|>
98
programminghorror
omgpliable
hk1v2z3
<|sols|><|sot|>Gotta double check real quick<|eot|><|sol|>https://i.redd.it/nkv4sgtq8py71.png<|eol|><|sor|>So much checking and still the code will _always_ do `EXIT_FAILURE`<|eor|><|sor|>if there is a race condition to change x!=100 before the 2nd check it won't exit<|eor|><|sor|>Or if your computer explodes<|eor|><|e...
81
programminghorror
Drak1nd
hk1mqoy
<|sols|><|sot|>Gotta double check real quick<|eot|><|sol|>https://i.redd.it/nkv4sgtq8py71.png<|eol|><|sor|>//protects against cosmic ray bit flipping<|eor|><|sor|>Or simply someone does not understand thread synchronization and locking.. Is that perhaps globally shared variable?<|eor|><|sor|>hopefully if you have a glo...
71
programminghorror
servel333
hk3k59v
<|sols|><|sot|>Gotta double check real quick<|eot|><|sol|>https://i.redd.it/nkv4sgtq8py71.png<|eol|><|sor|> That second else statement renders me questioning reality<|eor|><|sor|>Maybe there's threading going on, or the dev is worried about buffer over flow from the unshown terrible code around this block. /j<|eor|><|e...
54
programminghorror
marxama
hk1knfu
<|sols|><|sot|>Gotta double check real quick<|eot|><|sol|>https://i.redd.it/nkv4sgtq8py71.png<|eol|><|sor|>Is that what thread safe means?<|eor|><|sor|>Nah you gotta run it in a loop for that<|eor|><|eols|><|endoftext|>
49
programminghorror
Just_Maintenance
hk1kvr4
<|sols|><|sot|>Gotta double check real quick<|eot|><|sol|>https://i.redd.it/nkv4sgtq8py71.png<|eol|><|sor|>[deleted]<|eor|><|sor|>Obviously they are lacking a third check...<|eor|><|eols|><|endoftext|>
45
programminghorror
Stereojunkie
hk262gw
<|sols|><|sot|>Gotta double check real quick<|eot|><|sol|>https://i.redd.it/nkv4sgtq8py71.png<|eol|><|sor|>Is that what thread safe means?<|eor|><|sor|>Nah you gotta run it in a loop for that<|eor|><|sor|>while(x==100){ x = 100; }<|eor|><|eols|><|endoftext|>
45
programminghorror
Obnoxious-Split
hk1eyec
<|sols|><|sot|>Gotta double check real quick<|eot|><|sol|>https://i.redd.it/nkv4sgtq8py71.png<|eol|><|sor|>What the fucking is this supposed to do<|eor|><|sor|>Double check X is 100<|eor|><|eols|><|endoftext|>
42
programminghorror
servel333
hk3oa55
<|sols|><|sot|>Gotta double check real quick<|eot|><|sol|>https://i.redd.it/nkv4sgtq8py71.png<|eol|><|sor|>//protects against cosmic ray bit flipping<|eor|><|sor|>This guy must be an aerospace dev.<|eor|><|sor|>I worked at a company that made blood glucose meters and we definitely had meters that came back with a singl...
42
programminghorror
anyfactor
nhxb1d
<|sols|><|sot|>If it works, it works.<|eot|><|sol|>https://i.redd.it/zbq4buss7i071.png<|eol|><|eols|><|endoftext|>
3,864
programminghorror
justatog
gyz3vad
<|sols|><|sot|>If it works, it works.<|eot|><|sol|>https://i.redd.it/zbq4buss7i071.png<|eol|><|sor|>This should be tagged as not safe for work<|eor|><|eols|><|endoftext|>
854
programminghorror
bistr-o-math
gyze722
<|sols|><|sot|>If it works, it works.<|eot|><|sol|>https://i.redd.it/zbq4buss7i071.png<|eol|><|sor|>Unit test passed<|eor|><|eols|><|endoftext|>
616
programminghorror
bestjejust
gyz6mr5
<|sols|><|sot|>If it works, it works.<|eot|><|sol|>https://i.redd.it/zbq4buss7i071.png<|eol|><|sor|>return 7<|eor|><|eols|><|endoftext|>
478
programminghorror
Krewsy
gyzphtr
<|sols|><|sot|>If it works, it works.<|eot|><|sol|>https://i.redd.it/zbq4buss7i071.png<|eol|><|sor|>Unit test passed<|eor|><|sor|>sum(1,6) sum(2,5) sum(3,4) sum(7,0) yep, everything looks good to me, boss!<|eor|><|eols|><|endoftext|>
400
programminghorror
DiskFormal
gyyoovu
<|sols|><|sot|>If it works, it works.<|eot|><|sol|>https://i.redd.it/zbq4buss7i071.png<|eol|><|sor|>Oooh the scope of this is really something else...<|eor|><|eols|><|endoftext|>
325
programminghorror
pau1rw
gyz5925
<|sols|><|sot|>If it works, it works.<|eot|><|sol|>https://i.redd.it/zbq4buss7i071.png<|eol|><|sor|>Oooh the scope of this is really something else...<|eor|><|sor|>Oh that's it.... I was like... The temp var isnt great, but it's not horror.<|eor|><|eols|><|endoftext|>
187
programminghorror
Farfignugen42
gyzbx0x
<|sols|><|sot|>If it works, it works.<|eot|><|sol|>https://i.redd.it/zbq4buss7i071.png<|eol|><|sor|>Oooh the scope of this is really something else...<|eor|><|sor|>Oh that's it.... I was like... The temp var isnt great, but it's not horror.<|eor|><|sor|>Meh, could have just return numA+numB, but I suppose the point is ...
143
programminghorror
Reelix
gyzxik4
<|sols|><|sot|>If it works, it works.<|eot|><|sol|>https://i.redd.it/zbq4buss7i071.png<|eol|><|sor|>Unit test passed<|eor|><|sor|>sum(1,6) sum(2,5) sum(3,4) sum(7,0) yep, everything looks good to me, boss!<|eor|><|sor|>sum(0.6,0.3) .... :| ... Now that I'm looking at it - It doesn't actually do anything - `...
102
programminghorror
SpaceNinjaDino
gyzcn8y
<|sols|><|sot|>If it works, it works.<|eot|><|sol|>https://i.redd.it/zbq4buss7i071.png<|eol|><|sor|>Oooh the scope of this is really something else...<|eor|><|sor|>Oh that's it.... I was like... The temp var isnt great, but it's not horror.<|eor|><|sor|>Meh, could have just return numA+numB, but I suppose the point is ...
100
programminghorror
ImitationRicFlair
gz0doc2
<|sols|><|sot|>If it works, it works.<|eot|><|sol|>https://i.redd.it/zbq4buss7i071.png<|eol|><|sor|>Unit test passed<|eor|><|sor|>sum(1,6) sum(2,5) sum(3,4) sum(7,0) yep, everything looks good to me, boss!<|eor|><|sor|>sum(0.6,0.3) .... :| ... Now that I'm looking at it - It doesn't actually do anything - `...
87
programminghorror
chunkyasparagus
gyzpy9x
<|sols|><|sot|>If it works, it works.<|eot|><|sol|>https://i.redd.it/zbq4buss7i071.png<|eol|><|sor|>Make sure that the sum of the input variables is always 7 and you are always gonna get the correct result.. lmao..<|eor|><|sor|>A broken clock is accurate twice a day!<|eor|><|eols|><|endoftext|>
73
programminghorror
Jackplox
gyywpm4
<|sols|><|sot|>If it works, it works.<|eot|><|sol|>https://i.redd.it/zbq4buss7i071.png<|eol|><|sor|>this is killing me<|eor|><|eols|><|endoftext|>
49
programminghorror
King_Capital47
gyzqc1z
<|sols|><|sot|>If it works, it works.<|eot|><|sol|>https://i.redd.it/zbq4buss7i071.png<|eol|><|sor|>Make sure that the sum of the input variables is always 7 and you are always gonna get the correct result.. lmao..<|eor|><|sor|>A broken clock is accurate twice a day!<|eor|><|sor|>I created a terrible sorting algorithm ...
47
programminghorror
Shriukan33
gyz9gwi
<|sols|><|sot|>If it works, it works.<|eot|><|sol|>https://i.redd.it/zbq4buss7i071.png<|eol|><|sor|>Oooh the scope of this is really something else...<|eor|><|sor|>Oh that's it.... I was like... The temp var isnt great, but it's not horror.<|eor|><|sor|>Meh, could have just return numA+numB, but I suppose the point is ...
38
programminghorror
abejfehr
gyze5xu
<|sols|><|sot|>If it works, it works.<|eot|><|sol|>https://i.redd.it/zbq4buss7i071.png<|eol|><|sor|>I am a beginner what is wrong with this? For me when I use return it does not even out put anything. Other than that it seems fine. EDIT: is it because of numA and numB?<|eor|><|sor|>It doesnt sum the two things being p...
37
programminghorror
AnotherRichard827379
gyz8q4k
<|sols|><|sot|>If it works, it works.<|eot|><|sol|>https://i.redd.it/zbq4buss7i071.png<|eol|><|sor|>[deleted]<|eor|><|sor|>With incorrect scope? Pay attention to the variable names.<|eor|><|eols|><|endoftext|>
34
programminghorror
Last_Wallaby_3727
th26f5
<|sols|><|sot|>3 days of troubleshooting. Only for this to be the problem<|eot|><|sol|>https://v.redd.it/rdysdl6bg5o81<|eol|><|eols|><|endoftext|>
3,781
programminghorror
LeatherDude
i15v591
<|sols|><|sot|>3 days of troubleshooting. Only for this to be the problem<|eot|><|sol|>https://v.redd.it/rdysdl6bg5o81<|eol|><|sor|>The plural of regex is regrets<|eor|><|eols|><|endoftext|>
1,304
programminghorror
captnkrunch
i15zgeq
<|sols|><|sot|>3 days of troubleshooting. Only for this to be the problem<|eot|><|sol|>https://v.redd.it/rdysdl6bg5o81<|eol|><|sor|>The plural of regex is regrets<|eor|><|sor|>I had a problem, and I chose regex to solve it, than I had two problems.<|eor|><|eols|><|endoftext|>
329
programminghorror
Last_Wallaby_3727
i15n60p
<|sols|><|sot|>3 days of troubleshooting. Only for this to be the problem<|eot|><|sol|>https://v.redd.it/rdysdl6bg5o81<|eol|><|sor|>There are a million online tools to verify regular expressions.<|eor|><|soopr|>How about you verify some bitches? Respectfully<|eoopr|><|eols|><|endoftext|>
205
programminghorror
Techismylifesadly
i15r7cf
<|sols|><|sot|>3 days of troubleshooting. Only for this to be the problem<|eot|><|sol|>https://v.redd.it/rdysdl6bg5o81<|eol|><|sor|>I one spent 10 days trying to debug an issue, to find out the developer before me was indexing a variable that wasnt an array. Causing it to return undefined. The screaming fit I wanted to...
202
programminghorror
Tubthumper8
i15y5b7
<|sols|><|sot|>3 days of troubleshooting. Only for this to be the problem<|eot|><|sol|>https://v.redd.it/rdysdl6bg5o81<|eol|><|sor|>I one spent 10 days trying to debug an issue, to find out the developer before me was indexing a variable that wasnt an array. Causing it to return undefined. The screaming fit I wanted to...
167