| ▲ | Kwpolska 2 hours ago | |||||||
As with all guidelines, some people will turn it into a hard rule, and build a linter to enforce it. Then they will split long functions into shorter ones, but with a lot of arguments. And then their other linter that limits argument count will kick in. | ||||||||
| ▲ | VBprogrammer 40 minutes ago | parent | next [-] | |||||||
And someone else will use the idea that this is a misconception to justify putting hundreds of lines in one function. Some junior dev will then come along with his specific user story and, not wanting to tear the whole thing up, will insert his couple of lines. Repeat over a 10 year lifecycle and it becomes completely unmanageable. I remember trying to tease apart hundreds of lines of functions in a language which didn't have the IDE support we have these days. It was always painful. Even the most script like functions I've ever worked with benefit from comments like:
These subheadings can just as easily become functions. If you limit the context in each function it becomes a genuine improvement. | ||||||||
| ▲ | n4r9 an hour ago | parent | prev [-] | |||||||
Sounds like an opportunity to guide that person. | ||||||||
| ||||||||