Does D have too many features?

SomeDude lovelydear at mailmetrash.com
Tue May 1 07:41:42 PDT 2012


On Tuesday, 1 May 2012 at 14:31:25 UTC, Alex Rønne Petersen 
wrote:
>
> 1) So because some people might use a feature incorrectly due 
> to lack of knowledge in algorithms and data structures, we 
> should cripple the language?

It's not crippling the language. Nothing prevents you from 
writing a loop.
Or using a library find function that does the same thing. But 
the name "find" gives you a hint that it's not magical and that 
it has a cost, while with "if( foo in bar)", it is too easy to 
forget that we are actually potentially performing an O(n) 
operation. In an AA, the 'in' keyword performs a O(1) operation, 
so that's ok to use it as a syntactic sugar.




More information about the Digitalmars-d mailing list