James G. Sack (jim) wrote:
Andrew Lentvorski wrote:
James G. Sack (jim) wrote:

Such long structures are, IMO almost always indicators of code that can
be made easier to understand and maintain by pulling out functions.
You know ... I'm unconvinced.

There is a balance between pulling functions out and having everything
in front of you.

Of course, I tend to like to see a dead tree version of all the code at
least once.  Maybe it's just my own personal failing.

I *hate* navigating heavily refactored code.  When I react viscerally to
something, that's a good sign that *something* is wrong, but I just
can't quite figure it out.

Understood. The folding idea would seem to address my desire to see
large-chunk abstractions just as well as function calls. But I've never
gotten comfortable (competent) with folding tools. I have seen people
that did use them, do so with quite effectively.

To me, folding is just like pulling things out into a separate function. I don't find it makes code navigation easier.

I found folding to be useful when I was stuck with a gazillion functions in a single file. I could collapse the excess visual noise and focus on the function which I was editing.

Within a function, I don't find folding useful except if I suddenly commented out a big chunk and want it hidden. And, with version control systems local and quick, I'm likely just to commit a checkin and delete the code knowing that I can revert.

Given how easily editors, build systems, versioning systems, etc. now handle multiple files, I don't feel the need for folding like I used to.

-a

--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to