for loop parens

Jonathan M Davis jmdavisProg at gmx.com
Fri Jul 12 23:35:36 PDT 2013


On Saturday, July 13, 2013 07:03:28 QAston wrote:
> On Saturday, 13 July 2013 at 04:56:19 UTC, Jonathan M Davis wrote:
> > On Saturday, July 13, 2013 06:42:57 QAston wrote:
> >> On Friday, 12 July 2013 at 20:46:21 UTC, ixid wrote:
> >> > Yes, I don't expect anyone to change their opinion though
> >> > frankly the anti-groups opinions feel more like attachment to
> >> > the status quo than something that's evidently and
> >> > demonstrably
> >> > superior.
> >> 
> >> I think that Python has syntax evidently and demonstrably
> >> superior to D. Why not Python?
> > 
> > I think that that's very disputable. In general, which syntax
> > is better than
> > another syntax is very subjective. Personally, I hate Python's
> > syntax and find
> > it far harder to deal with than that of languages like C/C++ or
> > D. The lack of
> > braces alone is a huge annoyance for editing code (being able
> > to hop between
> > braces in an editor is invaluable for getting to the beginning
> > and end of
> > functions, scopes, classes, etc.), and it's easy enough to find
> > rants where
> > people have had bugs in their python code due to spacing issues
> > and how it
> > cost them hours to find them.
> > 
> > Yes. Some people prefer python's syntax, but I don't see how
> > anyone could
> > possibly claim that it was demonstratably superior. It's
> > primarily a
> > subjective issue, and from what I've seen, the objective
> > portions of the
> > argument are very much against python as having braces and
> > semicolons and the
> > like makes the code more explicit and therefore less prone to
> > scoping issues.
> > So while that tradeoff may very well be worth it for some
> > people, it's
> > certainly not an objective advantage for python's syntax.
> > 
> > - Jonathan M Davis
> 
> I agree, I was just playing games with ixid.

Ah. Clearly I read through the posts too quickly.

I should probably add though that the problems that the lack of braces cause 
in python with regards to moving around in the code in an editor also apply to 
parens, which would be an objective reason why getting rid of parens on for 
loops would cause problems. Obviously, it could be argued that how the code 
looks without parens would be better than with parens and worth the problems 
it would cause with text editors, but that would be a completely subjective 
argument.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list