Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
.AsEnumerable just after table name. Which will... load the whole damn 35 millions record table. Just because dev couldn't make "trim" work inside LinQ query.
And on the "good" side :
A while loop which changes direction automaticlly based on some criteria and allows 3 directions. (Forward, backward, "best in slot") -
iceb11562yI don't think send = enabled ? true: false is that bad
super readable/understandable. it's not like it obscured anything. -
We3D26722yI had to make a txt file with pearls... but in the hurry of covering their asses ( or mine ) I usually just fix it and continue on the next one... and lately I haven't seen WTFs so I can't bring something from the cache...
-
Example from our legacy PHP app:
if (isset($_GET['data'])) {
$data = $_GET['data'];
} else (isset($_POST['data'])) {
$data = $_POST['data'];
}
It is a spaghetti nightmare: written like it's 1999. Not even MVC, just, duplicated code everywhere.
Code, like the example above, is in the top section of almost every file. There is no router btw, just raw dogging .php-files. And forget classes: there are no models. Just pure SQL, directly persisting state changes. Manual testing only btw.
This thing was (!) vulnerable to SQL injections and XSS and CSRF. Took us at least half a year fixing it, now that I'm thinking about it. Lucky, we are in the midst of rewriting it (greenfield!) 🥰. -
@SuspiciousBug am in similar position - we have MVC and automated tests now (just not enough)
-
A single line can't be that bad since it's just a single line. The real horror are global variables that are touched here and there and affect this and that.
-
JsonBoa30142yMore than SIX THOUSAND LINES OF PYTHON CODE IN A SINGLE FILE, that did EXACTLY the same thing, because the script kiddie that crapped it was afraid of defining functions.
Also, as he told me in as many words, was "too lazy to use for/while loops, so just copy/pasted the same thing many many times"
That shit was like a fucking megabyte of a single code file.
Related Rants
Calling all Devs 🤙:
What's the _best_ worst code you've seen in the wild in your corporate codebases?
Include a snippet of the traumatic lines in your comments!
I'll start with a classic:
$send = $enabled ? true : false;
question
hell
awful code
legacyshit
cowboy devs