Example from a freeBootCamp article showed as a valid example of good pratice.2d ⋅ Constant__Pain ⋅ r/badcode
All I asked for was something to generate random strings. Ended up with 276 lines of this x3 files1mo ⋅ FOSSphorous ⋅ r/badcode
So this is the source code of the official solution of a problem from the National Olympiad1mo ⋅ vladvlad002 ⋅ r/badcode
Apparently Java can only handle 255 parameters in a constructor...6d ⋅ 646c726f576f6c6c6548 ⋅ r/badcode
Can we all please take a moment to appreciate this gem which was uncovered in a production DB class today.2mo ⋅ Mc_UsernameTaken ⋅ r/badcode
Not sure if visual scripting is allowed, but this is quite literally the definition of spaghetti code2wk ⋅ joujoubox ⋅ r/badcode
Just started a virtual work experience, and the first task was to clone a git repo. I had a look through, and it turned out the 3 python files all used different indentation... Tabs, 4 Spaces and 2 Spaces.1mo ⋅ SpicyElectrons ⋅ r/badcode
Don't know how to create JSON with multiple dictionaries? No problem! Add comma to end of every dictionary, delete last comma and add ], validate with string length!2mo ⋅ heysub ⋅ r/badcode
I saw this in a YouTube tutorial. Because sure, `ull` and `long int` are basically the same right?3mo ⋅ IHaveRedditAlready_ ⋅ r/badcode
Very innovative approach by 8yo me. What do all negative numbers have in common?11mo ⋅ MaKo1982 ⋅ r/badcode
This was from months ago when I was just starting out. Still doesn't excuse the fact that it's garbage code2wk ⋅ jaysuchak33 ⋅ r/badcode
Back when I was still a beginner in pygame, I somehow thought that putting the game's scenes into while loops is a good idea.2wk ⋅ zyenapz ⋅ r/badcode
[Line 104]: To me this seemed the simplest way to do it, but it feels really cursed.6mo ⋅ rs277_ ⋅ r/badcode
I found some old code from when I was first learning Java and I hadn’t learned about switch statements yet3mo ⋅ pavilionhp_ ⋅ r/badcode
There can't be a better algorithm for counting how often a value appears in an array4mo ⋅ MaKo1982 ⋅ r/badcode
Some... math-thingy I found in an old project. Pretty sure I just brute-forced that at the time.2mo ⋅ derMilchUndSaftMann ⋅ r/badcode
The first time I tried to make a Chrome extension I didn't understand how JavaScript callbacks worked, so I threw in a bunch of setIntervals and would check every 50ms to see if my variables were initialized2mo ⋅ RalphORama ⋅ r/badcode
My beautiful function for getting rid of punctuation from a string from my data structures class. I probably was so proud of this when I wrote it too.1mo ⋅ _Syd_knee_ ⋅ r/badcode
My code. In production. Making it work at all costs... For some reason it wouldn't return when false in an if statement :(1mo ⋅ jaweissavl ⋅ r/badcode
This code is an entire 4 lines shorter than an equivalent switch case, and it only cost me the remainder of my soul! (Nested ternary operators)6mo ⋅ Jemhop ⋅ r/badcode
Here is the 1/3 of the code used for user's login code that i have inherited2mo ⋅ woopsix ⋅ r/badcode
My University's Login Page. The username field's name is asdf and the password field's name is fdsa11mo ⋅ lollordftw ⋅ r/badcode
When all else fails sometimes you need more conditionals.... This subreddit inspired me to dig this 4+ year old teammate contribution up.2mo ⋅ arrexander ⋅ r/badcode
Found from when I first started Java...because indexed Arrays were too complicated huh?1mo ⋅ ahadyboy ⋅ r/badcode
EA published their Command&Conquer Code on github. This is my favorite part so far.11mo ⋅ Achereto ⋅ r/badcode
Found this in a StackOverflow answer. The worst part is they knew about dictionaries as seen at the beginning of the code, yet they proceeded to use a bunch of different variables anyway7mo ⋅ pxOMR ⋅ r/badcode
A piece of code I wrote for a class a couple year ago that generates every possible Tic-Tac-Toe board9mo ⋅ homicidalhero8 ⋅ r/badcode
Teaching my little brother c++. I told him to declare the function as bool9mo ⋅ Catalinu23 ⋅ r/badcode
Just a 2nd year CS major, but I ended up in a group with non CS students that wanted to come up with the model for a sudoku assistant themselves at all costs...3mo ⋅ honestly-idk- ⋅ r/badcode
Found this piece of junk timer I wrote ~4 years ago, somehow never deleted the source7mo ⋅ weetabix_gryphon ⋅ r/badcode