D vs. C#

Yigal Chripun yigal100 at gmail.com
Sat Oct 20 16:25:55 PDT 2007


Mike wrote:
> Hi,
> 
> I have some advanced knowledge of programming with C and C++.
> While I like C for its simplicity and speed, it lacks some important functionality (like OO). I'm not very fond of C++, since it is quite clumsy. (But you know all that already)
> 
> Anyway, I was looking for a new programming language for little projects. I looked into the specs of the D language and became quite fond of it. Anyway, I hear a lot of good things about C# as well.
> I am not experienced enough to compare the two simply on the basis of their specifications. I tried finding some comparison on the internet but failed to find anything more recent than from 2003.
> 
> I was wondering about the advantages of either and languages, and in which case one is more appropriate than the other and I hope you can help me out!
> 
> 
> Many thanks in advance,
> Mike

I personally see no reason to use c#. My main points are:

1) it's a poor imitation of Java. Java may have its cons but at least 
they try to be consistent with the design of the language - every new 
feature goes through a JSR. this may make the language to evolve in a 
slower rate though. compare that to the MS approach of including the 
kitchen sink. the language has many features meant for corner cases 
which makes it bloated.
on the other hand other features were discarded like the covariance of 
return types, which is heavily used in Java land.

2) who needs another proprietary language?? that's the most important 
issue for me. the mono project is a VERY stupid idea. it's a lost cause 
and a wasted effort - trying to play catch-up to MS while it constantly 
introduces breaking changes to the spec. just look at another project 
that needs to be compatible to MS - Samba. they need to jump through 
hoops to make it work - and that project is a necessary evil to make 
Linux and windows boxes work together.
the best way to look at this is through history, check MS' past actions. 
for example if you look at VB. the new VB.net is a very different beast 
than the classic VB. from what i hear, half the vb coders like the new 
features a lot, while the other half claim MS ruined the language. no 
one asked the community what they want.
i also bought software written with .net v1.1 which was abandoned due to 
.net v2 being not compatible with previous versions, forcing the company 
to rewrite the software from scratch which they didn't do due to lack of 
resources.

3) i don't see enough commitment from MS to the .net platform. Sun for 
example is fully committed to its Java platform as you can see by 
yourself - most (if not all) of their software is written with Java.
can you say the same about MS? I don't think so. besides various toy 
utilities not even one major piece of software from MS is written with 
.net. in my book, if even MS itself prefers c++ for its products why 
should should i think anything different?

_conclusion_ - if you want to run on a VM use Java it's open source and 
free. if you're looking for something more high-level, there are many 
other languages built on top of the JVM, I'd recommend checking Scala 
for example.

you could also use a dynamic language such as Python or Ruby (i 
personally like Ruby syntax more).

if you want a language that compiles to native code, providing you with 
all the power of C++ but with all the niceties of a modern language with 
a GC, than take a deep look at D. note that D is open source, except for 
the back-end of the official compiler made by Walter. however there is 
at least one other working compiler which uses gcc as its back-end.
all round D is a much improved version of C++ with many new features 
already built-in in a consistent way.

just my thoughts..





More information about the Digitalmars-d mailing list