6 ms·
First, it's very portable. Second, performance is as good or better than pretty much anything else that is not optimized C or C++. Finally, there are many reaso
by quonn 14y ago
First, it's very portable.
Second, performance is as good or better than pretty much anything else that is not optimized C or C++.
Finally, there are many reasons to love C# beyond interfacing with MS technology. It's a very beautiful language, much nicer than Java used to be and in many respects better than even the latest Java language. And innovation continues: If you've worked with node.js for some time, you will see how ugly code becomes where everything is done using callbacks. C# just now introduced new syntax where you can basically write code in a linear way and the nesting of callbacks is done by the compiler.
- codewright 14y ago>it's very portable Mono, I'm guessing you mean. Mono's not great for server applications, it's best used for desktop apps. If you want to write server apps, you need to be using the official Microsoft implementation. (Which is becoming the red-headed stepchild platform in Microsoft's strategy apparently?) > Second, performance is as good or better than pretty much anything else that is not optimized C or C++ Lets find out: http://shootout.alioth.debian.org/u64q/which-programs-are-fastest.php http://shootout.alioth.debian.org/u64q/which-programs-are-fa... List of things that are faster than C#: Fortran, Ada C, C++, ATS, Java, Scala, Common Lisp (SBCL), and Go. List of things that aren't faster than C#, but are close enough to call it a wash: Haskell, Ocaml, Clojure, Pascal, Racket I'd say you have some choices if performance is an issue yet C#'s is acceptable. >It's a very beautiful language, much nicer than Java used to be No, yes. It's nicer than Java, it's not "very beautiful". Try working through the Little Schemer to see a beautiful language. >And innovation continues: If you've worked with node.js for some time, you will see how ugly code becomes where everything is done using callbacks. Bizarre strawman? What? I don't like Node.js either, but what's your point? A lot of languages that aren't C# have better concurrency idioms than Node. You know, like all of them that aren't C#. > C# just now introduced new syntax where you can basically write code in a linear way and the nesting of callbacks is done by the compiler. Yeah, uh, Scala has had this since forever. And Lisp. And Scheme. And Clojure. And C++. And Node.js (ugh). For a C++ example, look at Tame/Tamer, SFSLite, etc. For anything else, google "promises". There is nil that is special about C#, it's a slightly nicer Java without a home or a stable implementation. If neither of those things matter to you and you wanted a Java++ that wasn't as ambitious or intellectually challenging as Scala, then you've found your language. Godspeed.
- throwAway7936 14y agoMono certainly works on the server. Your comment just tries to derail the discussion by bringing up Scheme or Lisp in a context where only languages are considered that are widely used in the industry. Otherwise, how could the word "abandon" possibly apply? This language shootout has been criticized before. Except for optimized C and C++ there is no popular language (I'm talking about the performance that is due to the design of the language, _not_ a particular implementation. For example dynamic typing is necessarily slower.) that is faster than C#. Try unsafe C# and you know what I mean. Bringing up Scheme here is entirely inappropriate. It's common wisdom that Lisp and Scheme are more beautiful, but this article is about a language that is supposedly "abandoned", because it may not be mainstream enough anymore at some point. If C# is abandoned, then what can you say about Scheme? As far as node.js is concerned, it's not a strawman: In fact, the people who claim that MS abandoned C# think that they want to replace it by Javascript. MS even supports node.js in Azure. "concurrency" is not the same as asynchronicity, which is what I was talking about. And promises are not even close what C# 5.0 tries to achieve. In fact, promises have been present since .NET 4.0. Finally, please explain how Scala is "intellectually challenging". This is not my experience. (throwaway account due to procrastination setting)
- igouy 14y ago>> This language shootout has been criticized before. << Criticism can be uninformed, out-of-date, self-serving, mistaken... ;-)
- snogglethorpe 14y ago> Except for optimized C and C++ there is no popular language (I'm talking about the performance that is due to the design of the language, _not_ a particular implementation. For example dynamic typing is necessarily slower.) that is faster than C#. Er, but you can't just completely disregard implementation, because it really matters in practice. You're not going to get a lot of adoption simply because your language is theoretically better/faster/... In these language shootouts, Lua, a dynamically-typed language aimed at small size and simplicity, regularly beats out C#, because Lua has LuaJIT[+], which is a really good implementation, whereas C# for many people means Mono, which is at best an "OK" implementation. It's the same as with algorithms: big-O complexity is obviously important, but it isn't everything; for real-world uses, the constant factors may make all the difference... [+] The standard Lua implementation is also very good, but it's a more typical VM, and while very fast for a non-JIT VM, can't match LuaJIT in many cases.
- Raphael_Amiard 14y ago> Second, performance is as good or better than pretty much anything else that is not optimized C or C++ You are kind of overlooking the JVM here. Also Mono is kind of portable, and .Net on windows is fast, but you can't really have both (even if Mono performance is decent)
- codewright 14y ago>You are kind of overlooking the JVM here I did criticize OP too, but you'll note that he made a point of saying that C# was nicer than Java. The fact that he isn't aware the JVM has more than just Java, is an issue I attempted to redress.
- throwAway7936 14y agoHow can you claim that I'm not aware that the JVM is more than Java? I did not even mention the JVM.
- qznc 14y agoTheoretically, the CLR-VM should be able to reach better performance than the JVM, since it has value-types. Within the JVM an array of some objects is really an array of references, which is bad for your hardware caches and requires an additional pointer dereference. The question is how significant that is for non-numerical applications.
- Someone 14y agoTheoretically, your sufficiently advanced compiler and/or JVM will figure out where they can replace objects by value types. So, theoretically, that does not matter. The difference should be visible in practice, though. AFAIK, it is not really visible, though. That probably is because the JVM has been tuned longer.
- migueldeicaza 14y agoIn practice, value types are a huge performance differentiator. That is why even the simplest benchmarks involving value types tend to beat Java's optimized code gen.