| ▲ | VBprogrammer an hour ago | |
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. | ||