Quora: Why hasn't D started to replace C++?

Jonathan M Davis newsgroup.d at jmdavisprog.com
Fri Feb 9 21:48:34 UTC 2018


On Friday, February 09, 2018 13:39:22 Walter Bright via Digitalmars-d wrote:
> On 2/9/2018 6:01 AM, Atila Neves wrote:
> > Unit tests are a great idea, right? Try convincing a group of 10
> > programmers who have never written one and don't know anyone else who
> > has. I have; I failed.
> Unit tests are one of the great success stories of D. I believe it was a
> success because it was so simple to add unit tests to the code, and to
> run those tests.
>
> D's unit testing system didn't even need to be very good. It just had to
> be *easy*. And that changed everything.

Yeah. git did the same thing for me for source control. Before, I almost
never did anything with source control with my personal projects, because it
was too much of a pain to set up; you basically had to set up a server to
talk to (even if it was on the same machine), whereas with git, it's just

git init .

and you have a repository. Now, all my source code goes in a git repo unless
it's just a quick test that I'm going to throw away when I'm done. And the
fact that places like github and bitbucket make it so easy to create repos
online means that a lot of my stuff is online too, whereas if I had to use
something like SVN, I'd probably have next to nothing in source control.

And the way that D handles unit tests has had the same effect. If I were
doing all of my personal projects n C++, I don't know how many would be unit
tested. Anything really serious would be, but the extra effort of setting
something up to be able to have unit tests is enough that anything simple
would probably never have any tests, because it would be too much effort for
me to bother. Having unit tests built-in is definitely a game changer.

- Jonathan M Davis



More information about the Digitalmars-d mailing list