OT: Website CMS

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Tue Aug 25 14:15:07 UTC 2009


On Mon, Aug 24, 2009 at 11:09:13PM -0400, Rajinder Yadav wrote:
> Thanks William, I was thinking this might be the case about
> indentation and my (silly) bias. Unfortunately I have seen too many
> bad C/C++ code that has been well indented yet has too many nesting to
> make it readable.
> 
> Also with many IDEs one can jump to the start and end of a code block,
> since the IDE can match braces. I don't see how this is possible with
> Python style code? If I am writing my own code, or the blocks are
> small or not nested than I have no issues, but from my experience this
> is not always the case.
> 
> If I am going to inspect and use community code, I don't want poorly
> factored nested code to get in my way. I think that is my bigger
> concern.

Which would you rather have:

function foo
        while (something)
                if (something else)
                        print "Hello\n";

or

function foo {
while (something) {
if (something else) {
print "Hello\n";
}
}
}

or perhaps simply:

function foo
  while (something)
    if (something else)
      print "Hello\n";

Personally I am one of those people that like tab indentation, since
then I can adjust it to what I like without changing the code.
Some people don't like it, but oh well.

> I guess this is one of those (personal) things when you get over it
> you get over it, but I am not there =) .... maybe I need to look at
> some production python code to convince myself and not let something
> like this get in the way of using a (possibly) good framework.
> 
> Thanks for sharing your similar experience, I am sure I am not the 1st
> or last developer to have this gripe about python.

Braces are NOT helpful in making it have a better overview.  And teaching
an editor that indentation is what defines blocks is trivial.

The best way to avoid too deep nesting is to avoid too deep nesting.
Braces or indentation doesn't matter, it's still the same level of
nesting.

-- 
Len Sorensen
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list