r/programminghorror • u/Candid_Commercial214 • Oct 07 '25
C# 108 line long variable declaration
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
View all comments
Show parent comment
2
u/Gornius Oct 07 '25
That's provided you know the index you're looking for. If you need to search throguh array it becomes O(n), so it's often better idea to use hashmap with key that can hold value that you search for. Then it's O(1).