Worst code you've ever seen | Sololearn: Learn to code for FREE!


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

6/16/2017 6:53:46 AM

Elethelectric Penguin

11 Answers

New Answer


int i = 1; if (i == 1) { i = 1; }


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!




@Jakub Stasiak omg


Core 3 pub6. eeeek!


var i = 0 while (i == 0){ alert("hsjdjdjsk") }


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.


@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



I quite ofte get a laugh from reading this: https://blog.codinghorror.com