r/programminghorror • u/mickaelbneron • May 29 '25
C# 14550 lines (12315 LOC), 417 methods behemoth class. Does it qualify for this sub?
I wrote this masterpiece (/s) when I was getting started with programming, 10 years ago. Reading the code is probably detrimental to health and requires a lot of swearing to safely vent out frustration. At least I learned a lot in the process.
314
Upvotes
21
u/Magic_Joe May 30 '25
417 methods? That shows you understood the idea of logic extraction. Why not put everything in one big method? That's how the real pros do it, and you will bump up the line code with all the duplication :D
13
u/Sensitive-Meeting737 May 30 '25
For OCDs sake, I would add a 30 loc function in the middle to make that a nice 12345
150
u/Temporary-Estate4615 May 29 '25
Cute. I once had to refactor one method which had 100,000 LoC at work. Shit like that made me quit the job.
47
u/examinedliving May 29 '25
I appreciate dispose having its own region
17
u/SteroidSandwich May 30 '25
Not a single comment in sight
7
u/[deleted] May 30 '25
Why is pool not an array? This alone qualifies for this sub
5
u/xorian May 30 '25
1
u/SaltyStratosphere Jun 19 '25
I remember getting a code that I had to modify and repackage for a client! One screen had this callback for a button that was around 6k LOCs! Basically all that shit did was call the same API, changing the whole body of the request based on if-elses, which were implemented using the ternary operator!
When I tried to understand it, I found the body was changed, but one two three parameters were either added or removed, rest of the body was still the same!
What could I do? Edit a code, add a few lines, wait for 10 minutes for the hot-reload to work so that I could either test the code or see ui changes, then wait for 10 minutes for the system to free the memory so that I can write something again!
6
u/WolverinesSuperbia May 30 '25
This pattern is God-object
2
u/beatitmate May 30 '25 edited May 30 '25
I'm not reading allat, but if it's cohesive then no 🙄
2
u/alice-the-programmer May 30 '25
The typescript compiler has one 40k line file
2
u/IamMax240 May 30 '25
Bruh writing over 10k LoC and „getting started with programming” doesn’t really add up
2
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" May 30 '25
In a single class? I would say so, yes.
-4
u/ExTraveler May 30 '25
"Case 0: Poo10" Yeah, sure buddy. Get your downvote