Why is D unpopular?
Walter Bright
newshound2 at digitalmars.com
Sat Apr 30 20:38:46 UTC 2022
On 4/30/2022 12:33 PM, Dukc wrote:
> On Saturday, 30 April 2022 at 17:39:04 UTC, Walter Bright wrote:
>> On 4/30/2022 1:32 AM, Paulo Pinto wrote:
>>> Switching gears to ranges, we have Smalltalk-80 collections as one possible
>>> example,
>>>
>>> https://www.researchgate.net/publication/2409926_Interfaces_and_Specifications_for_the_Smalltalk-80_Collection_Classes
>>>
>>
>> C++ went the iterator approach. Ranges in C++ occurred only after D did them.
>
> We're strange. IIRC Bjarne's third C++ book from 1998 already discusses a bit
> about ranges, albeit calling them "sequences". It shows a few examples how they
> can work, by pairing iterators into one type, and then goes on to other topics.
There is little choice in C++ but to use a pair of iterators. The next step was
to put them together into std::pair, but that simply went nowhere in C++ until
Eric Niebler decided to do something about it.
> Spending any amount of time using Phobos ranges will reveal them as clearly
> superior to iterators in common usage. One would think that when the idea has
> been around at least 24 years, ranges would have long since displaced iterators
> as the recommended standard C++ construct. Yet no.
Iterators had gotten very, very entrenched in C++ by then.
> BTW, As I understand it ranges came to D at around 2008 or 2009. Out of
> interest, what was D's way of doing the same tasks before that?
D didn't have a metaprogramming way of doing that before.
Ranges based on dynamic arrays were a natural fit for D.
More information about the Digitalmars-d
mailing list