Quote:
Originally Posted by jjshabado
I'm not advocating for big functions. I'm not saying it's better than a well thought out refactoring. I'm claiming that there are lots of bad refactorings out there and that just because they use small functions doesn't mean they're better than the equivalent big function.
Edit: Bolding the important part that I feel isn't clear between us.
jj,
as i said the debate is silly at this point without examples. but since you took the time i'll respond to this. you seem to be worried about the programmers who have taken the time to learn about refactoring, but not taken the time to *really* learn, and hence misapply it in their over-zealousness to modularize everything.
i'm not saying this can't be bad, it's just not what i'm generally worried about. i rarely come across it, and when i do it usually has some sense to it, because the authors actually care about the code on some level and are trying to do good even if they suck at it.
the far far more common error is people who have learned to code but never made any effort to learn about standards or refactoring or best practices. they just make all the classic errors that OO patterns and best practices were designed to avoid. duplicate code, lack of encapsulation, tight coupling of unrelated things.
this is the bread and butter of bad code, and as a programmer these are the people whose code will cause you the most pain and whose code you will encounter far more often.
i guess ymmv. but that's my experience.
EDIT: so yeah, i agree with the bolded part in theory. but if you told my one coder wrote average 50 line functions one coder wrote avg 5 line functions, and i had to choose which coder's project to work on without any more info, i'd choose the 5 line guy in a heartbeat.