r/programminghorror • u/mickaelbneron • Feb 26 '26
C# From the repetition, to the lack of coding convention, to the obscure Y prefix, to everything else, I hate everything I see in this code.
203
Upvotes


21
u/jordansrowles Feb 26 '26
Can tell just by looking this is early 2000's legacy enterprise .NET. Can tell by the ADO.NET, hashtable sorted procs. Its pre ORM.
No excusing the mess though.
123
u/Juff-Ma [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" Feb 26 '26
Not to defend them, but I've written such code in one single Situation: when I had to work with an absolute dogshit of an external API. Whatever the people that designed it were smoking, it was probably the last thing they smoked because nobody who survived the act of writing this API would've looked at it and said: "Yup, that's fine".
So if they designed their own interfaces like this, shame on them. If they are forced to retrieve external data structured like this, may god have mercy on them and their sanity.
32
u/m4sc0 Feb 26 '26
I just love how there are no comments whatsoever in the first image (although it is bad code, they could've at least commented it) and then there's the beauty where they commented "Add the parameter" for one line.
Yea, that's peak commenting! /s
21
u/kurtmrtin Feb 26 '26
7
u/Cotton-Eye-Joe_2103 Feb 26 '26 edited Feb 26 '26
I love the Allman style of the first image, though. Even seeing code formatted that way makes me happy, more interested in the code and makes me more prone to forgive and forget any kind of programming horror.
5
u/daqueenb4u Feb 27 '26
Dapper that sh*t
3
u/Prestigious_Storm_94 Feb 26 '26
Looks like something I'd code lol.
5
u/EinsPerson Feb 27 '26
The real programming horror is light mode Visual Studio
2
u/Head-Challenge-7461 Feb 26 '26
Y el número de linia!!!
2
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" Feb 27 '26
I can see a lot of redundant code in the first image, but I don't know what's wrong with the second. Nor do I see that Y prefix you are talking about.
2
u/MeLittleThing Feb 26 '26
DS != null && DS?.Tables.Count > 0... What aboutif (x != 42 && !(x == 42)) { }to also make sure?1
u/Dexatronik Feb 27 '26
I love the 4 slash comments in the 2nd image. 2 slashes wasn't comment emough. They wanted to be extra sure.
1
u/Natural-Angle-5395 Feb 28 '26
I have a better question, why are we coding in LIGHT MODE
1
u/robertlandrum Mar 01 '26
And now I have hives.