Revised RFC on range design for D2

KennyTM~ kennytm at gmail.com
Fri Sep 26 04:18:21 PDT 2008


Andrei Alexandrescu wrote:
> Bruno Medeiros wrote:
>> As a matter of coding style conventions, I would say that using the 
>> implicit property function call feature on a function that changes 
>> state is *bad* style, and surely hope the community would agree on that.
> 
> I sure hope they won't agree to an unsupported assertion.
> 

Actually I *do* hate this "feature" ^_^.

And this "feature" has been put to challenged before:
  * Bug 2159. (http://d.puremagic.com/issues/show_bug.cgi?id=2159)
  * "Omitting Parens is an Evil" 
(http://www.digitalmars.com/d/archives/digitalmars/D/Omittable_parens_is_an_evil_73881.html)
*http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=D&artnum=17579
But nothing got changed.

To the very least, when using next as a property I assume the call won't 
produce any secondary effect on src from the syntax, since I'm just 
reading a state! Not so if one calls src.next() as the "()" is an 
alarming sign that src _may_ change afterwards. This could is just a 
problem of personal taste since the compiler does not forbid src.next(), 
but not so if you're reading other's code.

P.S. If src.next() is too lengthy, why not just adopt ++src?

>> So "src.next" would be must better as "src.next()" as "src.next" 
>> really just makes me cringe.
> 
> With me it's the opposite, particularly after I've written and stared at 
> a few hundreds of "()"s due to a compiler bug.
> 
> 
> Andrei


More information about the Digitalmars-d-announce mailing list