DEV Community

Discussion on: What is the ideal length of a code for you?

Collapse
 
xtofl profile image
xtofl

I like it terribly short (under 10 lines); preferrably zero (most stuff has been written already).

Why? Because I find myself more often reading and trying to reverse-engineer a function's intent than trying to find all the details of every possible network interaction. Longer function bodies often have much repetition, nesting etc... which clutter the overview.

I found many people find the opposite: they want to see the details, and don't want to jump back and forth to find them.

But really, shouldn't we start having IDE's that make this irrelevant? Refactoring tools can extract details from long function bodies; I guess the code viewing tools could easily do the opposite: inline the details when you're from 'the wrong camp' ;).