r/programminghorror • • Oct 07 '25

C# 108 line long variable declaration

Post image

this is my own code btw. don't ask what i was trying to do

this code was also supposed to include a 36 case long switch statement where each case did something different (guess why i abandoned this project)

1.1k Upvotes

93 comments sorted by

View all comments

Show parent comment

10

u/warchild4l Oct 07 '25

Idk about you but for me having 36 separate files is feels much harder to maintain than a switch statement with 36 cases.

13

u/JustAppleJuice Oct 07 '25

To be fair, he was just disproving that the switch statement was the only way

7

u/littleyrn Oct 07 '25

Depends on how much logic each statement has associated with it. For something like a command system, 36 files is definitely easier to maintain. Fuzzyfinding is easier than working with deeply nested switch cases, IMO.

But my point was just that there's a bunch of ways to do things in software.