Py3K idea: why not drop the colon?

Antoon Pardon apardon at forel.vub.ac.be
Wed Nov 15 03:22:46 EST 2006


On 2006-11-15, Steven D'Aprano <steve at REMOVEME.cybersource.com.au> wrote:
> On Tue, 14 Nov 2006 12:01:05 +0000, Antoon Pardon wrote:
>
>> On 2006-11-13, Ben Finney <bignose+hates-spam at benfinney.id.au> wrote:
>>> Michael Hobbs <mike at hobbshouse.org> writes:
>>>
>>>> To be clear, this is the actual thrust of my argument. It seems
>>>> redundant to have *both* line continuations and colons in compound
>>>> statements.
>>>
>>> Why are you trying to remove redundancy?
>> 
>> Why not? My impression is that removing redundancy is considered
>> a positive thing here in c.p.l.
>
> Redundancy in *what*?

Redundancy in whatever proposal the opponent doesn't like.

> Redundancy is not something to be valued for its own sake. It is only
> valuable when it actually gains you something.

In the same way it is not something to be eliminated for its own
sake. But if someone doesn't like a particulare proposal and
the proposal happens to introduce some redundancy then there is
a reasonable chance the proposal will be dismissed by simply
observing that it introduces redundancy.

> The question is not "is the colon redundant?" but "is the colon useful
> despite, or even because, its redundancy?". There are two schools of
> thought:
>
> (1) Yes, it is useful, *because* of its redundancy -- it helps the human
> reader parse and comprehend the source code.
> Evidence given: usability studies by the ABC project.

I wonder, did this project also studied the readability of:

  if a == b then

> (2) No, it is not useful, because the computer parser doesn't need it.
> Evidence given: "it seems to me" repeated loudly until our ears bleed.

A pity that no such study seems to exists concerning code that uses
only indentation to mark structure and code that uses indentation
and some kind of delimiter for showing the boundaries of (sub)
structures. Because the evidence for end markers not being usefull
seems to fall in the same category as (2) here above.

-- 
Antoon Pardon



More information about the Python-list mailing list