D is crap

Charles Hixson via Digitalmars-d digitalmars-d at puremagic.com
Mon Jul 11 12:45:24 PDT 2016


Garbage collection allows many syntax "liberalizations" that lack of 
garbage collection renders either impossible or highly dangerous.  (In 
this definition of "garbage collection" I'm including variations like 
reference counting.)  For an example of this consider the dynamic array 
type.  You MUST have garbage collection to use that safely...unless you 
require the freeing of memory with every change in size.  C++ does that 
with the STL, but if you want the dynamic types built into the language, 
then you need garbage collection built into the language.  (This is 
different from saying it needs to be active everywhere, but once you've 
got it, good places to use it keep showing up.)

One of the many advantages of the dynamic array type being built into 
the language is that arrays of different sizes are reasonably comparable 
by methods built into the language.  This is used all over the place.  
In D I almost never need to use "unchecked conversion".

On 07/11/2016 02:30 AM, Chris via Digitalmars-d wrote:
> On Sunday, 10 July 2016 at 03:25:16 UTC, Ola Fosheim Grøstad wrote:
>>
>> Just like there is no C++ book that does not rant about how great 
>> RAII is... What do you expect from a language evangelic? The first 
>> Java implementation Hotspot inherited its technology from StrongTalk, 
>> a Smalltalk successor. It was not a Java phenomenon, and FWIW both 
>> Lisp, Simula and Algol68 were garbage collected.
>
> Please stop intentionally missing the point. I don't care if Leonardo 
> Da Vinci already had invented GC - which wouldn't surprise me - but 
> this is not the point. My point is that GC became a big thing in the 
> late 90ies early 2000s which is in part owed to Java having become the 
> religion of the day (not Lisp or SmallTalk)[1]. D couldn't have 
> afforded not to have GC when it first came out. It was expected of a 
> (new) language to provide GC by then - and GC had become a selling 
> point for new languages.
>
> [1] And of course computers had become more powerful and could handle 
> the overhead of GC better than in the 80ies.
>
>> What was "new" with Java was compile-once-run-everywhere. Although, 
>> that wasn't new either, but it was at least marketable as new.
>>
>>> Java was the main catalyst for GC - or at least for people demanding 
>>> it. Practically everybody who had gone through IT courses, college 
>>> etc. with Java (and there were loads) wanted GC. It was a given for 
>>> many people.
>>
>> Well, yes, of course Java being used in universities created a demand 
>> for Java and similar languages. But GC languages were extensively 
>> used in universities before Java.
>
>>> Yes, it didn't last long. But the fact that they bothered to 
>>> introduce it, shows you how big GC was/is.
>>
>> No, it shows how demanding manual reference counting was in 
>> Objective-C on regular programmers. GC is the first go to solution 
>> for easy memory management, and has been so since the 60s. Most high 
>> level languages use garbage collection.
>
> It wasn't demanding. I wrote a lot of code in Objective-C and it was 
> perfectly doable. You even have features like `autorelease` for return 
> values. The thing is that Apple had become an increasingly popular 
> platform and more and more programmers were writing code for OS X. So 
> they thought, they'd make it easier and reduce potential memory leaks 
> (introduced by not so experienced Objective-C coders) by adding GC, 
> especially because a lot of programmers expected GC "in this day and 
> age".
>



More information about the Digitalmars-d mailing list