On Wed, Jan 02, 2008 at 10:26:46PM -0800, James G. Sack (jim) wrote:

Although folding could help I suppose. Does (eg, vim) folding work with
Python?  Does anyone here use folding a lot?

Yes, and no.  Intent based folding is by far the easiest to configure in
vim.  But, I've never found folding to be useful.  Maybe if I learned it
better it would be, but I think not using it more encourages me to factor
my code better.

I think Linus puts it well:

   "The maximum length of a function is inversely proportional to the
   complexity and indentation level of that function.  So, if you have a
   conceptually simple function that is just one long (but simple)
   case-statement, where you have to do lots of small things for a lot of
   different cases, it's OK to have a longer function."

It's also his argument for an indent width of 8.  If that gets difficult to
manage (he also limits to 80 columns), the code is getting to complex for
his tastes.

The need for good code factoring was most severe when I was programming in
Forth.  More than a couple of lines of code and a Forth word can become
unreadable.  I'm not sure if I would say I miss it or not.

Dave

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

Reply via email to