"Andrei Alexandrescu" <seewebsiteforem...@erdani.org> wrote in message news:gto3np$2bl...@digitalmars.com... > Georg Wrede wrote: >> bearophile wrote: >>> >>> While reading the source code of Phobos2 function calls like ".front" >>> confuse me, I find ".front()" more readable. I think I am not the >>> only one to think like this. >> >> >> The docs should be consistent and clear, also in trivial matters. If >> something is a function, then the parens should be there. The reader may >> know that you can omit the parens, but it has to be easy for him to >> recognize a name as a function. > > Omitting parens gives more options. For example, infinite ranges are > defined and recognized as: > > enum bool empty = false; > >
See, this is a good reason why "()" vs "no ()" should be dictated by the API, not the caller. Under the current system, there's nothing preventing someone from writing an "is this range empty?" check that seems to work on one range, but then fails to compile on any range that chooses to implement "empty" as in your example above.