You are a stupid programmer, you can't have that

Paul Backus snarwin at gmail.com
Tue Aug 10 18:46:57 UTC 2021


On Tuesday, 10 August 2021 at 17:47:48 UTC, H. S. Teoh wrote:
> I think this is what Andrei has been saying every so often: 
> stop deleting, start adding.  I.e., never remove old features, 
> just add new ones to be used in favor if necessary.  If needed, 
> deprecate and hide away old features (hide away the docs so 
> that new people don't accidentally use it for new code), but 
> never, ever remove it. If a new, better way to do something is 
> discovered, add it to the language, highlight it front and 
> center in the docs, but don't ever remove the old stuff.  If we 
> need to redesign Phobos, for example, do it in a new namespace, 
> don't remove/replace the old one.  Make it possible for the two 
> to coexist.  Accretion rather than replacement.
>
> OT1H the idealist in me screams "please break my code, fix the 
> language to remove all the broken stuff!".  OTOH the long-term 
> code maintainer in me shakes his fists every time a compiler 
> upgrade breaks one of my old projects.
>
> The solution to the conundrum is, accretion rather than 
> replacement. Let the old code compile.  Complain about 
> deprecations if you have to, but don't ever make it not compile 
> (unless it was an outright bug to have compiled in the first 
> place).  But new code can use the new stuff and benefit from it.

Of course, the obvious counterargument is that this approach is 
exactly how you end up with a language like C++: powerful in the 
hands of experts, with a large and successful ecosystem, but 
packed to the gills with pitfalls and footguns for beginners to 
hurt themselves with.

Ultimately, that's the question D's leadership has to answer. 
What's more important to D's future: existing users of D, or 
potential future users of D?

C++ has a lot of inertia, and doesn't necessarily need to attract 
new users to continue being a successful language. But I'm not 
sure the same is true for D. If C++ holds onto legacy features 
that cause pain for beginners, people will grumble and put up 
with it, because C++ is so entrenched that they have no better 
option. If D does the same thing, people are more likely to just 
leave for Rust, or Go, or C#.


More information about the Digitalmars-d mailing list