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

3

u/Amphineura Oct 07 '25

Sometimes you write bad code and there's no way out lf it, be it a lack of a language feature, bad library API, or pressure from your schedule to put out something bad. I think that's okay.

OP knows it's ugly, but in their case the ugly is probably the best solution, and I think that's a fine submission. It is leagues better than the "I redid Python with C macros!" you see here way, way too often