Why don't other programming languages have ranges?

Walter Bright newshound2 at digitalmars.com
Sun Jul 25 16:03:41 PDT 2010


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.

Of course they are experts and smart. That doesn't mean they won't make 
mistakes. Both Java and C# have added generic support only after several cycles. 
We'll see how long Go manages to resist adding it. My prediction is Go will not 
become a mainstream language without it.


> C# designers have shown to be sometimes smarter than D designers.

And D sometimes has smarter decisions than C#. I think the statement is meaningless.



> 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.

I think that's projecting a lot of the weaknesses of the C++ implementation onto 
D, and I don't think that is justified. For example, D simply doesn't have the 
compilation speed problems C++ has.

The code bloat issue is resolvable with implementation effort, and neither C# 
nor Java have ever had any shortage of resources thrown into their development. 
The same goes for bug-prone-ness.

D has gone a long way towards reducing the language complexity issue. D 
templates are *far* simpler than C++ ones, yet more powerful. I also don't see 
how C# generics are simpler (for the user) than D templates, and C# generics are 
quite complex under the hood.



> 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 think a better article is here: 
http://windowsdevcenter.com/pub/a/oreilly/windows/news/hejlsberg_0800.html

The msdn article makes some misinformed statements.


> 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.

The computer language space is far, far too large for any one programmer (no 
matter how expert & smart) to be experienced enough in all the varied paradigms 
to make informed tradeoffs.


More information about the Digitalmars-d mailing list