D vs. C#

bearophile bearophileHUGS at lycos.com
Wed Oct 24 04:53:42 PDT 2007


I like D better. But C# has some advantages too, two things I have personally seen (beside the IDE, the STD lib, the more widespread usage, the standard GUI toolkit, etc):

- Using strings as keys the unordered Associative Arrays of C# (on dotnet 3.0) are up to many times faster than D AAs, expecially when the memory used by the AA becomes large (like 50 MB).
- C# VM is able to parallelize code by itself, so if you have two CPU cores even small proggies with loops can end being quite faster (up to almost two times faster, in some tests I have done), and you don't need to change your sourcecode to do that (in C++ you can use OpenMP but you have to modify the code and you have to be careful, to avoid breaking your code in many interesting ways).
- The VM allows you to use different languages, like IronPython, F#, etc, sometimes you can even mix them to write your languages.

(Note: the shootout used Mono, not dotnet, that is probably much faster).

Bye,
bearophile



More information about the Digitalmars-d mailing list