Why is std.algorithm so complicated to use?

Jonathan M Davis jmdavisProg at gmx.com
Mon Jul 9 16:34:54 PDT 2012


On Tuesday, July 10, 2012 01:20:21 Timon Gehr wrote:
> > Now, with the current version of github, it unfortunately
> > seems to spit out a bunch of duplicate messages for the same error/warning
> > with templates in a number of cases, and _that_ should be fixed, but the
> > warnings themselves are generally solid and indicators of a real problem.
> > 
> > And as I've expressed in the past, I think that -property is very much
> > doing the right thing and that not strictly enforcing properties is
> > horrible,
> Language design shouldn't be based on statements like "I think it is
> horrible". There is nothing objective in it.

Without -property, it's lax. The rules aren't enforced. It allows you to use a 
function as if it were a property when it's not. Language rules should be 
strictly enforced not be left up to the programmer whether they want to bother 
following them or not. That just leads to confusion and bugs. If the API 
states that it's @property, so it should be used as a property. If the API 
says that it should be used as a function, then it should be used as a 
function. You wouldn't use () on a variable would you (aside from defining 
opCall)? I should think not, and I don't think that () should be left out on a 
function any more than they should be used on a variable. It's sloppy and 
confusing.

Regardless, TDPL calls for strict property enforcement, so that's where we're
headed.

- Jonathan M Davis


More information about the Digitalmars-d mailing list