D vs. C#
Julio César Carrascal Urquijo
jcesar at phreaker.net
Thu Nov 23 19:41:05 PST 2006
Andrey Khropov wrote:
> Frank Benoit (keinfarbton) wrote:
>
>> I want to write an article about D. Therefore I want to show more
>> details and advantages of D compared to C++, Java and C#. But I never
>> used C#.
>>
>> What are concrete things that are better in D or C#? Can you make examples?
>
> I think the biggest thing is that you have no metaprogramming support in C#
> (only type-parametrized classes and functions via generics) whereas you have
> templates in D.
>
> Plus DbC and built-in unit testing.
>
> Another good thing C# lacks is aliases (AFAIK only namespace aliases are
> supported) and strong typedefs.
>
> Anyway there's a comparison page http://www.digitalmars.com/d/comparison.html
>
Aliases are supported on C# 2.0 although a lot more limited than in D.
// Alias a namespace
using Utilities = System.Collections;
// Alias a class.
using List = System.Collections.ArrayList;
// Alias an instance of a generic class.
using IntegerList = System.Collections.Generic.List<int>;
That's about all you can make an alias for on C#.
More information about the Digitalmars-d
mailing list