Why don't other programming languages have ranges?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Jul 25 18:21:05 PDT 2010


On 07/25/2010 04:54 PM, bearophile wrote:
> Andrei Alexandrescu:
>> In my humble opinion, the design of Java, C#, and Go is proof that
>> their authors didn't get the STL. Otherwise, those languages would
>> be very different.
>
> I don't believe you. Among the designers of Java, C# and Go there are
> people that are both experts and smart. C# designers have shown to be
> sometimes smarter than D designers. So I think some of them 'get the
> STL' and understand its advantages, but despite this in the universe
> they have found some other reasons to refuse it. I think they were
> unwilling to pay the large price in language complexity,
> bug-prone-ness, code bloat and compilation speed that C++ and D are
> willing to pay.

But then their containers and algorithms are markedly inferior to STL's. 
They are toxic to the programmers who have only been exposed to them. So 
Java and C# got STL and decided to not go with it, I'm sure they would 
have at least gotten a few good bits from it. But no - the entire e.g. 
Java container library is parallel to everything STL stands for.

> Here you can find why C# designers have refused C++-style templates&
> STL and chosen the generics instead:
> http://msdn.microsoft.com/it-it/magazine/cc163683%28en-us%29.aspx One
> important problem of C# generics can be solved adding
> IArithmetic<T>: http://www.osnews.com/story/7930
>
> I like D templates and I agree that adding them to D1 was a good idea
> (mostly because D1 is designed to be similar to C++) but you must
> accept that some language designers can understand STL and still
> refuse to add all the features necessary to implement it.
>
> Maybe there is a way to build something like STL without C++/D-style
> templates :-)

I'm sure there is, and Java and C# could have come a long way. But 
taking their libraries at face value, they are simply ignorant of STL's 
values - to their detriment.


Andrei


More information about the Digitalmars-d mailing list