On Wed, Jan 02, 2008 at 05:12:32PM -0600, Gabriel Sechan wrote:

I have never in my life seen the indentation wrong but the braces right.
I have seen the reverse, frequently.

I have, unfortunately.

While you can put a brace in the wrong spot as a bug, you can do the same
with whitespace.  You'll never get that type of error from just moving
code around.  THis is absolutely a reason why indent based blocking is a
bad thing.

I guess I don't understand.  When moving blocks of code around, I _often_
have to fix up braces and such to make the structure of the code correct.
Generally, I have to fix both the braces and the indentation to get what I
want, and it is usually the indentation that tells me when things are
wrong.

The times I've been bitten where were the indentation was correct, but the
braces didn't get copied with the right part of the block.  It was only the
syntax error hundreds of lines later that pointed out the problem.

With indentation as the nesting itself, I only have to fix one of these,
and that's the one that is blatantly obvious.

Please don't tell me you would even consider using the code with the
indentation wrong.

Indent based blocking is an attempt at solving a social problem (people
who don't indent, although I've never actually met one of these people)
with a technical solution (indentation as semanticly meaningful).  That
just doesn't work-  you're causing at least as many problems as you're
stopping (probably far more, because I've never met a programmer who
didn't indent predictably) and adding in whole new classes of bugs.  The
correct answer is to educate the people who don't indent.

Where did you get the idea that indentation based blocking is trying to
solve this problem?  It was created for people who were indenting so that
they only had to specify the nesting in one way.  It certainly isn't
primarily motivated as a way to force people to indent.

You're right, I meant to type auto-shift.  Same issue though-  if your
language requires an editor to have a specific tool to avoid a common bug,
your language is fatally flawed.  Python isn't even a remote consideration
for me due to this.  I've actually rewritten small (

The language doesn't require anything more out of my editor than another
laugnage does.  I need my editor to be able to match braces to be able to
do sane rearrangement of code in C, and I need it to be able to change
indentation for Python.  Actually, I would argue that the indentation
change is much easier to do manually than trying to match braces visually.

Again, this seems to be more of an argument in favor of Python, rather than
against.

Dave

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

Reply via email to