It is the year 2020: why should I use / learn D?

bauss jj_1337 at live.dk
Fri Nov 16 07:15:32 UTC 2018


On Wednesday, 14 November 2018 at 15:07:46 UTC, lagfra wrote:
> https://www.reddit.com/r/cpp/comments/9vwvbz/2018_san_diego_iso_c_committee_trip_report_ranges/
>
> By 2020 C++ is planning to introduce:
>
> * Ranges
> * Contracts
> * Concepts (`__traits`)
> * Proper constexpr
> * Modules
> * Reflections
> * Green threads
>
> Right now it already has:
>
> * `auto` variables
> * Ranged for (`foreach`)
> * Lambda expressions and closures
> * `nothrow` attributes
> * Proper containers
> * Proper RAII
>
> In no way this is the usual trollpost (I am a participant of 
> SAoC). What bugs me is the shortening distance regarding what D 
> has to offer with respect to C++. While D for sure has a way 
> better syntax (thinking of template declarations, `immutable`, 
> UDAs) and a GC, what are the advantages of using D vs C++ if my 
> goal is to build a complex system / product?
>
> TL;DR: what will D offer with respect to C++ when almost all 
> key features of D are present in C++20(+)?

Because C++ still have terrible support for proper web 
development. This is a joke, but not really. There is nothing in 
C++ that's equivalent to anything currently available in D when 
it comes to web development. D is pretty close to what other 
popular languages can do such as Django (Python), ASP.NET (C# / 
.NET), Rails (Ruby), Node (JS) etc. C++ doesn't really have 
anything that's at an equivalent level. The closest thing is 
probably something like CppCMS, but not only is it old, it's also 
way behind some of the D frameworks :)

Also D will still have a much more beautiful syntax, C++ is never 
going away from the "ugly" syntax it has.

Templates will always be superior in D.

CTFE will still be superior to constexpr in C++, because D 
doesn't really have a difference between a runtime function and a 
compiletime function. I reckon that C++ will be much more limited.

There are a lot more than just language features that makes D a 
better choice than C++ in my opinion.

Also when C++ announces what they plan to implement for a 
version, usually half of the things doesn't make it and are 
usually brought up in the next version again, where they may or 
may not make it.

An example is modules in C++, it was planned for C++17 too as far 
as I remember.


More information about the Digitalmars-d mailing list