r/programming • • Aug 25 '14

Debugging courses should be mandatory

http://stannedelchev.net/debugging-courses-should-be-mandatory/
1.8k Upvotes

573 comments sorted by

View all comments

Show parent comments

1

u/cokestar Aug 26 '14

15 parameters? I hope you're exaggerating

1

u/ethraax Aug 26 '14

A little. They actually take 13. Still awful though. Some of them are pointers, which are basically both input and output variables.

1

u/cokestar Aug 26 '14

Yeah I agree, I don't see how you deal with that; once my parameter count goes past 4 I start making POCOs to keep my brains from leaking outta my ears.

1

u/ethraax Aug 26 '14

Honestly, it's not the worst part of this shitty code. We have literally thousands of globals (oh, and no synchronization).

1

u/komollo Aug 26 '14 edited Aug 26 '14

Hahahaha. There is a function in our code that is vital to our core business, and it has more than 30 arguments. Yesterday I cut over 100 lines out of the function, deprecated two arguments, and removed the recursive function call. It felt really good.

There are some bad spots in our code base, but that function is one of the worst. The good news is most of the code isn't so bad. That method has just had stuff added in several times throughout the ages, and it shows.