Why I like D

bearophile bearophileHUGS at lycos.com
Fri Dec 5 03:27:20 PST 2008

> I think for dynamic languages, test-driven development is mandatory.

I generally write tests after the code in all languages I use :-) Maybe I'll learn to use TDD in the future, who knows.

> But you have to write zillions of tests because the compiler accepts all 
> kinds of garbage. [...]
> I like that D gives us the best of both worlds -- you only have to write 
> tests to find the 'requires brain' bugs.

Unfortunately in reality the situation is a little different, and you end writing many tests in D too (take a look at my dlibs, there are more tests than code). One of the problems is that the tests you have to write "because the compiler accepts all kinds of garbage" aren't that many, and they are generally easy&quick to write and think about. Most of the programming & testing time is used elsewhere. But the dynamic languages allow you to save time in other ways. So for me the end result is that when programs aren't too much complex, I write correct Python code faster than correct D code (this includes testing time too). While when algorithms and ideas are complex, I take about the same time in both languages, because there are far more time-consuming things and details to think about.

I think in 5-10 year we'll look at the static/dynamic typing Wars like today we look at the C - Pascal Wars: as a thing of the past, as a storm in a bottle. Because probably most language will have a mix of both, with pluggable type systems too (two first examples that already exist: Python3 has optional function annotations that will be used by pluggable type systems, and C#4 has now ways to allow duck typing).


More information about the Digitalmars-d mailing list