C's Biggest Mistake on Hacker News

Ecstatic Coder ecstatic.coder at gmail.com
Tue Jul 24 09:54:37 UTC 2018


On Tuesday, 24 July 2018 at 00:41:54 UTC, RhyS wrote:
> On Monday, 23 July 2018 at 22:45:15 UTC, Walter Bright wrote:
>> I've predicted before that what will kill C is managers and 
>> customers requiring memory safety because unsafeness costs 
>> them millions. The "just hire better programmers" will never 
>> work.
>
> I have yet to see a company Walter where higher ups will take 
> correct actions to resolve issues.
>
> Customers do not understand **** about programming. Your lucky 
> if most clients can even get a proper specification formulated 
> for what they want. If clients are that knowledgeable we do not 
> need to constantly deal with issues where clients had things in 
> their heads different then what they told / envisioned.
>
> And most manager are not going to rock the boat and stick their 
> necks out. Not when they can simply blame issues on programmer 
> incompetence or "it has always been like that with programming 
> languages". I have yet to see managers really taking 
> responsibility beyond guiding the projects so they do not get 
> fired and hope to rack in bonuses. Issues can always be blamed 
> on the tools or programmers.
>
> Sorry but that response is so naive Walter that it surprises 
> me. Its like wanting a unicorn.
>
> And frankly, good luck convincing any company to convert 
> millions of C code into D code. Not when manager hear about 
> some new language or framework or whatever that is the chizz. 
> They rather keep running the old code and move to something 
> new. D is not something new, its not the chizz, its the same 
> issue that D has struggle with for years.
>
> Its the same reason why that topic derailed so fast. You want 
> to see something fun. Mention PHP on HackerNews/Reddit and you 
> see the exact same trolling. People rather push their new 
> favorite language, be it Go, Rust, ... then pick D.
>
> Response at my work when i made some stuff in D... "Why did you 
> not use Go". Because the managers knew Go from the hype. They 
> know Google is behind it. And some of our colleagues in sister 
> companies already used Go. And that is all it takes.
>
> I am sorry to say but to succeed as a language beyond being a 
> small or hobby language it takes: Being established already or 
> having a big name to hype behind your "product". Anything 
> beyond that will have topic derail and frankly, its more 
> negative then positive.
>
> And D has too much old baggage. Its the same reason why PHP 
> despite being a good language ( for what it is ), still keeps 
> getting the exact same crude on forums.
>
> If i am honest, DasBetterC is a for me unreliable D product 
> because using specific D library function can be GC. Or 
> DasBetterC needs to be sold as C only, ever, forget about 
> everything else that is D ( library, packages, ... ). Until 
> everything is 100% GC free, your going to run into this. And 
> even when its 100% GC free, people have long memories.
>
> Its always a struggle swimming up a river.

+1

IMO, D in its current state, and with its current ecosystem, even 
after more than a decade of existence, is still NOT the best 
alternative to C/C++ where they HAVE to be used 
(microcontrollers, game engines, etc), despite D has always had 
this objective in mind. And despite C++ is an unsafe language 
which makes it easy to have memory leaks, dangling pointers, etc.

Because in those case, most of the time, when you use C or C++, 
it's because you HAVE to, not only because they run fast, but 
also because they can run without on a garbage collector. Just 
that simple.

In C++, the memory is immediately released to the allocation 
system by the collections and smart pointers as soon as it's no 
longer used.

This may not be perfect, but this process is continuous and 
predictable. In D, unused memory block are progressively filling 
the available memory until the non-incremental GC is triggered, 
either automatically or manually. Completely the opposite way. 
Not really appropriate for a "forever" event loop, where the 
unused memory HAS be released in a continuous way, not once in a 
while.

And when you CAN afford to use a garbage collector, unfortunately 
D is still not the best pick in many use cases.

While D's standard library makes D a great "plug-n-play" language 
for file processing and data analysis, for many other use cases, 
like web development for instance, some very recent languages 
already provide better alternatives "out of the box" (Go, 
Crystal, etc), as there have PLENTY of third party libraries (web 
frameworks, etc) built on top of the SAME building blocks 
provided by the default libraries of those languages.

So, at the moment, I don't see how you can EASILY convince people 
to use BetterC for C/C++ use cases, like programming games, 
microcontrollers, etc.

Same if you want to EASILY convince people to start to use D 
today for many Go/C#/Java/etc use cases, like developing online 
services, web sites, etc.

Despite I know that some pioneer companies may have already 
chosen D for those same use cases, and are perfectly happy with D 
for that...

So my opinion remains that  :
- become a TRUE and COMPLETE C++ replacement, D should provide 
the FULL D experience (arrays/strings/slices/maps/etc) using 
automatic reference counting INSTEAD of the garbage collector 
(like Kotlin/Native);
- become a TRUE and COMPLETE Go/C#/Java/Scala/Crystal/etc 
replacement, D should provide the FULL Go-like experience (i.e. 
BUILTIN fibers/channels/server/etc).

Of course, removing everything that makes D a pleasant language 
to use (i.e. arrays/strings/slices/maps/etc), calling it 
"BetterC", and expecting people to use this instead of C++ might 
also work...



More information about the Digitalmars-d mailing list