Py3K idea: why not drop the colon?
carsten at uniqsys.com
Sun Nov 12 18:52:21 CET 2006
On Sat, 2006-11-11 at 23:18 -0800, Doug wrote:
> Michael Hobbs wrote:
> > I think the colon could be omitted from every type of compound
> > statement: 'if', 'for', 'def', 'class', whatever. Am I missing anything?
> > Thanks,
> > - Mike
> It is a very good idea as the colon is technically redundant (not
> necessary for parsing, aside from one liners) and actually hurts
> readability (and writeability). The "evidence" people cite for the
> advantage of using a colon is research done by users of the ABC
> language, python's predecessor. They forget that A) that was like 20
> years ago,
Research being old does not automatically invalidate it. Old research is
invalidated by newer research that invalidates it.
> B) the language was designed for children,
http://www.cwi.nl/archive/projects/abc.html does not mention children:
"Originally intended as a language for beginners, it has evolved into a
powerful tool for beginners and experts alike."
> and C) the
> keywords in ABC are IN ALL CAPS LIKE THIS (hurting readability and
> writeability) and thus adding a colon obviously helps restore some
> readability for users in that case but not in python's.
So what are you saying? In a programming language that doesn't use all
caps keywords, adding colons to block-beginning lines hurts readability,
or it doesn't add any readability?
In any case, that's an assertion that should be backed up by citing
> However, python is far too old to accept any fundamental changes to
> syntax at this point.
The source code for Python is openly available. If you are so convinced
of the added readability from removing the colons, do the world a favor
and make the necessary change, or hire somebody to make the change, to
More information about the Python-list