| Thread overview | |||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
October 20, 2007 D vs. C# | ||||
|---|---|---|---|---|
| ||||
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 | ||||
October 20, 2007 Re: D vs. C# | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Mike | 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
C# provides all the niceties of a RAD IDE and a cohesive and very broad standard library. You get this at the price of performance. C# is not native, but runs in a VM like Java. While it does do some JITing, D and other compiled languages will always be faster.
Additionally, I think D has a bit cleaner syntax, though C# is a huge step up from C++ in that respect.
Oh, and if it matters to you, D templates and metaprogramming blow anything C# has out of the water, yielding the potential for even more performance increases.
| |||
October 20, 2007 Re: D vs. C# | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Mike | 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! Choosing D over C# makes sense if 1) you care about getting every little last bit of performance out of your code (http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=dlang&lang2=csharp) or 2) you care about your apps not requiring a 20MB runtime/VM to work. and maybe 3 - 3) you care about portability. Though I think Mono makes it a non-issue? Other than that, I haven't used C# but I hear good things too. And obviously the community is much bigger, which translates to greater likelihood that someone will already have code you can steal that does some niche thing you need to do. And Microsoft's C# development tools certainly knock D's out of the water. oh and I forgot #4 reason to use D instead of C# -- 4) you want to be one of the "cool" kids. :-) --bb | |||
October 20, 2007 Re: D vs. C# | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Mike | Mike wrote: > 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) Lots of us escapees from C++ here using D, but myself I know Java more than I do C#. Although Java and C# probably has similar pros/cons when compared to the D language. > 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. You might also want to check out Vala, which looks like C# but compiles to C. More info at http://live.gnome.org/Vala (requires GLib and uses GObject system) --anders | |||
October 20, 2007 Re: D vs. C# | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Mike | 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..
| |||
October 21, 2007 Re: D vs. C# | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Kyle Furlong | "Kyle Furlong" <kylefurlong@gmail.com> wrote in message news:ffdqe7$pvi$1@digitalmars.com... > 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 > > C# provides all the niceties of a RAD IDE and a cohesive and very broad standard library. You get this at the price of performance. C# is not native, but runs in a VM like Java. While it does do some JITing, D and other compiled languages will always be faster. > > Additionally, I think D has a bit cleaner syntax, though C# is a huge step up from C++ in that respect. > > Oh, and if it matters to you, D templates and metaprogramming blow anything C# has out of the water, yielding the potential for even more performance increases. D also supports inline asm, C-like pointer syntax (w/o C#'s 'unsafe' and 'fixed') and easy use of C lib. routines. The price for most of that is a non-moving GC, but I think that those can be developed to rival the speed of the moving GC's. D's built-in array slicing mitigates a lot of the need for a super-fast GC as well. | |||
October 21, 2007 Re: D vs. C# | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Mike | On Sat, Oct 20, 2007 at 04:49:39PM -0400, Mike wrote:
> 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!
A couple of comparisons I can think of.
- D does nested classes "right". C# requires you to explicitly put the
parent class as a field in the child class, which is clumsy.
- C# generics (recent versions that have them) are true strongly-checked
generics. Somewhat less flexible than templates, but less prone to
strange errors. Some people find them more difficult to understand, I
find them clearer.
- C# has a stronger separation of managed and unmanaged (gc or not) data.
It is more work to call C functions, and it isn't as good at
manipulating data structures directly.
- The .NET libraries are much richer, a lot more like Tango.
Dave
| |||
October 21, 2007 Re: D vs. C# | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Yigal Chripun | On Sun, Oct 21, 2007 at 01:25:55AM +0200, Yigal Chripun wrote: > 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. C# fixes many problems with Java, at least in my opinion. C# 2.0 adds generics which cover many of the cases of templates. It has full support of the VM, so executes efficiently and safely. > 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. C# is not proprietary. It is an ECMA and ISO standard. What makes mono stupid? I've done development under mono and found it to work quite well. Where they play catchup is not the language but Microsoft's ever expanding proprietary libraries. A big advantage C# has over D is that it is a standard, and there are multiple implementations. It's tradeoff choices may not be appropriate for all applications (using a VM most importantly). I think for the most part, D is a better language. David | |||
October 21, 2007 Re: D vs. C# | ||||
|---|---|---|---|---|
| ||||
Posted in reply to David Brown | David Brown escribió:
> On Sat, Oct 20, 2007 at 04:49:39PM -0400, Mike wrote:
> - The .NET libraries are much richer, a lot more like Tango.
Especially the SortedList, which is... a dictionary! :-P
(well, that's the part I hate most of their library: collections... and also that a red-black tree is an internal class)
| |||
October 21, 2007 Re: D vs. C# | ||||
|---|---|---|---|---|
| ||||
Posted in reply to David Brown | David Brown wrote: > On Sun, Oct 21, 2007 at 01:25:55AM +0200, Yigal Chripun wrote: > >> 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. > > C# fixes many problems with Java, at least in my opinion. C# 2.0 adds > generics which cover many of the cases of templates. It has full support > of the VM, so executes efficiently and safely. > What exactly is broken in Java that C# does better, in your opinion? from what i see, anything that needs fixing is being fixed within the Java community and I personally trust their decisions a lot more than MS. Adding properties to a languages isn't considered "fixing" it, it's just a convenience feature. On the other hand, removing covariance of return types is a very big mistake. there are others of course, but that one really pissed me off. >> 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. > > C# is not proprietary. It is an ECMA and ISO standard. What makes mono > stupid? I've done development under mono and found it to work quite well. well, who is to prevent MS to publish a new "standard" every year? as I mentioned in my original post, I as a consumer got burnt on this exact issue. I paid 70$ for a piece of software i planned to use until the end of my degree. and that's quite expensive for a student in Israel. That piece of software was only scraped due to inability to port to a newer version of .net in order to support Vista and improve speed. MS didn't provide any way for them to upgrade except for re-writing the whole thing, which the company just didn't have the resources for. conveniently for MS as the company was making a product that competed with One note. and even today there are several features that they implemented much better than MS. that's just one way MS uses to push small ISVs that compete with it off the market. > > Where they play catchup is not the language but Microsoft's ever expanding > proprietary libraries. you can't really separate a language from it's standard library. almost every piece of code is dependent on that. have you used printf in your C program? well that's part of the standard C library. try to write an application without the standard library, and i assure you you won't get far. unless of course you're writing a kernel and need to implement printf by yourself.i don't think most application developers will go for that. hence, a change in the standard library would have the same effect as a change in the language itself. that's why Java takes a very cautious approach towards changing/deprecating parts of its standard lib. today, i can take a legacy Java 1.1 application and with minimal changes and probably a flag to the VM, i can run it on a modern Java 6 VM. that's a program written about 10 years ago. Can't say the same thing about a program written with any of MS tools. > > A big advantage C# has over D is that it is a standard, and there are > multiple implementations. It's tradeoff choices may not be appropriate for > all applications (using a VM most importantly). > would you call Microsoft's document format standard? being a standard means being accepted as the default by all parties, not just by one. > I think for the most part, D is a better language. i agree fully with that. > > David | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply