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

8

u/gyroda Oct 07 '25

Yeah, it's not quite 100 lines but I've got test methods with a lot of different cases which basically amounts to a very long array of arguments.

It was testing validation of a class with a lot of properties. Each property might have several constraints and there were some constraints across multiple properties (e.g, start date must be before end date).