Suggestion: Change precedence of 'new'

Scott S. McCoy tag at cpan.org
Fri Apr 11 21:43:14 PDT 2008


At the same time, the fact that parenthesis are optional is also quite
nice.

It allows accessing a member to magically become accessing an accessor,
and it eliminates unnecessary parenthesis on multiple statements which
makes trees nicer to access, consider DOM:

document.firstChild.firstChild.lastChild.parentNode;

This is a lot nicer than....

document.getFirstChild().getFirstChild().getLastChild().getParentNode();

To make the example less extreme, it's still nicer than:

document.firstChild().firstChild().lastChild().parentNode() and less
ugly.

But, it's not really a trade off that matters much in the long run.

Cheers,
	Scott S. McCoy

On Fri, 2008-04-11 at 13:46 -0300, Ary Borenszweig wrote:
> I really like how Java handles this: parenthesis are mandatory for 
> methods and constructors.




More information about the Digitalmars-d mailing list