+ 5

Worst code you've ever seen

We all know the horror of uncommented code. What's the worst thing you've seen? Caveat: Code in question must compile

16th Jun 2017, 6:53 AM
Elethelectric Penguin
Elethelectric Penguin - avatar
11 Respuestas
+ 14
int i = 1; if (i == 1) { i = 1; }
16th Jun 2017, 10:21 AM
Hatsy Rei
Hatsy Rei - avatar
+ 10
my old story generator code is very cringy. I didn't know what lists/arrays were. https://code.sololearn.com/caJd69PZto67/?ref=app props to this guy for stealing-...uh I mean preserving my old work!
16th Jun 2017, 10:30 AM
Ahri Fox
Ahri Fox - avatar
+ 7
@Jakub Stasiak omg
16th Jun 2017, 1:33 PM
Ahri Fox
Ahri Fox - avatar
+ 5
Core 3 pub6. eeeek!
16th Jun 2017, 7:11 AM
Michael Simnitt
Michael Simnitt - avatar
+ 3
var i = 0 while (i == 0){ alert("hsjdjdjsk") }
13th Apr 2019, 12:35 PM
Clueless Coder
Clueless Coder - avatar
+ 2
void setMoving(bool moving) { if(moving == true) { this->moving = true; } else if (moving == false) { this->moving = false; } } Yeah it was my code when I tried to write simple game at the beginning of my programming journey. You could call me mr. Optimization.
16th Jun 2017, 11:50 AM
Jakub Stasiak
Jakub Stasiak - avatar
+ 2
@Ahri you think your code has a lot of ifs? https://cdn.discordapp.com/attachments/285492834444771328/286610945063780352/0b7b209f2d27afce50a56a1749461de84d85ae235f21e803838d1a9782a5a4af.png This shall be my answer. Why do you need lots of ifs, when you can have one bigass if :D
16th Jun 2017, 12:03 PM
Jakub Stasiak
Jakub Stasiak - avatar
+ 1
Rofl oh dear
16th Jun 2017, 1:59 PM
Elethelectric Penguin
Elethelectric Penguin - avatar
+ 1
I quite ofte get a laugh from reading this: https://blog.codinghorror.com
17th Jun 2017, 2:08 PM
Kerrash
Kerrash - avatar
- 2
1234
16th Jun 2017, 2:58 PM
Daniel
Daniel - avatar