Python-like tabs instead of curley brackets?

Bill Baxter wbaxter at gmail.com
Fri Oct 27 17:56:12 PDT 2006


Charles Fox wrote:
> I've been following D for a few years now, and I'd like to suggest ditching
> the (now completely redundant) curley brackets from the C-like syntax and
> borrowing Python's use of tabs to replace them.   I see no reason to keep the
> curley brackets now we have nice editors that know about (and can display) tab
> characters.  The ideal programming language should have no redundancy, you
> shouldn't have to say anything twice, and at present we are still repearting
> ourselves with both curley brackets and indentation!  What do you think?

I like Python, but I find the use of tabs for scope to have both plusses 
  and minuses.  Even with a good tab-aware editor it's difficult to do 
major reworks of chunks of code.  Like cutting a big nested chunk of 
stuff from one place and dropping it into a another function somehwere 
else.  You have to be very careful when doing that kind of thing with 
Python code.   With a curly brace language the braces make sure you 
don't mess anything up.  Just paste it in however you want and hit your 
editor's 'reformat selection' button.

Also I was just looking through the Python mailing list archives the 
other day and saw lots of code snippets from which the leading 
whitespace had been stripped by news software or something along the 
way.  Including the braces is just more robust in the long term.

That said, it is nice to be able to omit all the ';' and '{' characters. 
  But like another person said it's 6 of one 1/2 dozen the other.  They 
both have pros and cons, and since D aims to be an easy transition 
language for C/C++ users, it makes sense to stick with the braces.

--bb



More information about the Digitalmars-d mailing list