7 ms·
What languages have you got experience with that you feel C# is the best language you have worked with? And what makes it such a good language for you?
by aerique 12y ago
What languages have you got experience with that you feel C# is the best language you have worked with?
And what makes it such a good language for you?
- jpgvm 12y agoGenerics, Partial Classes, awesome Reflection API, Lambda syntax, LINQ, C/C++ compatibility, async/await, concurrency primitives, etc. I have worked with prettier languages, for instance I have picked up Haskell recently, I have also worked with faster languages, C was my forte for many years and I have worked with languages in the GSD category like Ruby and Python. C# is appealing not because of some feature that it has that other languages don't. But rather the long list of things they didn't fuck up. For instance by building concurrency and evented programming semantics into the core there isn't multiple competing event loops for instance. (unlike say Python or Ruby which have about 5 each, Java has more than I can count). It's not so much there is one single thing that makes C# really nice, it's the whole package.
- SCHiM 12y agoYou know what I also really like about C# is the .net runtime. I know that allot of people dislike it because there's so much leftover stuff from previous versions, however despite this it's one of the most comprehensive runtimes I've every worked with. Want to make a screenshot of the desktop? Got it. Want to post keystrokes to another application? No problem. Ohh I see you want to write a tcp server with asynchronous processing? Here's some generics you can just c&p. I know other languages have these features too, but C# makes it so damn easy to use in the stdlib it's just not funny anymore.
- eyko 12y ago> Ohh I see you want to write a tcp server with asynchronous processing? Here's some generics you can just c&p. So we've come to the point where copy-pasteability is a language feature? Tell me I can use a library or module. Tell me that the language comes with built in features to help me do this or that. But never tell me I can copy-paste generic code. Please.
- mattmanser 12y agoThat's actually one of the features of C#, if something is needed or is hot in another language, it will appear in the core libraries. They've realised recently this is having a negative effect on open source C# code as so much of the community waits for the "offical" version, but it has its positives too, almost anything you want to do is in the core libraries.
- EdwardDiego 12y agoThis is my main grudge with .NET development, a culture of preferring The One True Way. It (among other things) leads to a lack of .NET FOSS diversity.
- Pxtl 12y agoThe biggest problem with this culture is that it means that when the One True Way is wrong, we suck it up and use it anyways. I mean, Entity Framework is great, WebAPI is slick, and MVC has its moments, but there are some real trainswrecks. I've used all three XML serializers in the .NET framework and they're all cringeworthy. ASP.Net WebForms could have been something spectacular with open development instead of the hideous monstrosity it was. And MSBuild would have been laughed out of the room and regarded as some kind of bizarre eccentricity like TempleOS or UrBit instead of a serious build system.
- Paradigma11 12y agoDont mock msbuild. i never slept as much or as well than when i tried to work through the documentation.
- koyote 12y ago>I've used all three XML serializers in the .NET framework and they're all cringeworthy. XmlSerializer, DataContractSerializer, and what is the third? I agree and was about to point out the same thing though; XML serializers in .NET are a joke but because they exist in the core libraries there is not really a compelling open source alternative. That being said, it seems like the Asp.Net Web API is actually using Json.Net instead of the built-in serializer.
- rip747 12y agoLINQ is _the_ only reason I tolerate .net
- alkonaut 12y agoYou mean C#? Let's keep those separate shall we? Linq makes C# much better, especially compared to java. It's a whole different story in F# though.
- Filligree 12y agoWhat's the story for F#? I'm a Haskell enthusiast, but it's not so good at Windows support, or libraries. I've been thinking F# might be just the ticket.
- louthy 12y agoF# has Query Expressions[1] which are just Computation Expressions[2], i.e. not a language extension, a library. If you know Haskell then it's pretty easy to get into F#. The only thing you'll miss are higher-kinded types. Although they can be hacked in[3], it's not really worth the effort a lot of the time [1] http://msdn.microsoft.com/en-GB/library/hh225374.aspx http://msdn.microsoft.com/en-GB/library/hh225374.aspx [2] http://msdn.microsoft.com/en-us/library/dd233182.aspx http://msdn.microsoft.com/en-us/library/dd233182.aspx [3] https://code.google.com/p/fsharp-typeclasses/ https://code.google.com/p/fsharp-typeclasses/
- platz 12y agoAgree - also I think f# can't dispatch on the return type of a polymorphic expression as I thought that was only possible with type classes?
- louthy 12y agoI think it's possible by including the return-type in the argument list and using inline operators. You really have to jump through hoops though to make it work and the resulting code is damn ugly. Take a look at the source for FsControl[1]. It implements what they call 'type methods'. So there's types for Monad.Bind, Functor.Map, Applicative.Pure, etc. I'm still trying to get my head around it; I thought I'd try to do so by implementing the core types and functions in Haskell's Pipes. So far I've managed to convince the F# compiler to take well over an hour to compile 70 lines of code! The main argument against them has been lack of CLR support. But it seems that there's already the FsControl way, so I think some syntactic sugar would go a long way. So yeah, until there's language support for type-classes I think it's probably not worth it. [1] https://github.com/gmpl/FsControl https://github.com/gmpl/FsControl
- V-2 12y agoI would add "yield" to your lits - a small feature, but it allows for very elegant code and easy implementation of deferred evaluation / execution.
- moonchrome 12y agoAlso it compiles fast and tools are really good. People keep bringing up Scala, last time I tried Scala (~ year back) the compile times were pretty long and the IDE support was sluggish and I have a decent PC. Nowhere near to C#/VS development experience.
- useerup 12y agoasync/await is HUGE. It opens an almost frictionless asynchronous pathway from your code all the way down to asynchronous capabilities of the underlying platform. Which was always the problem with leveraging async/overlapped IO: It was too complex and it turned your application logic inside-out because everything had to be performed in callbacks. async/await takes that on directly: You get everything executed in callbacks - only the callbacks are transparently created for you along with the necessary finite state machines so that your code still composes with exceptions, loops, branches working the way you expect - even across those "invisible" callbacks. For server scalability as well as responsiveness on small devices (keeping number of thread low - even at one - while still serving the UI), that is really an advantage. There is no "fakes" on the way - no extra threads being started just to wait for completion of an otherwise synchronous API. If the platform supports asynchronous IO/network/disk/database you can leverage that without any of the strange complexities of other languages. Worth mentioning here is that Windows has an easier scalable and better designed completion oriented async model compared to the readiness oriented model of Linux - which is mostly limited to sockets anyway. OS X has GCD - which is also a completion oriented model. I look forward to seeing how .NET with real global optimizing compilers from MS will do on OS X versus Linux versos Windows (on a Mac, obviously).
- Rapzid 12y agoTasks are pretty awesome and just about as convenient as Go-routines. Now if we could just get typed channels in .Net >:]
- tracker1 12y agoI don't think it would be very hard at all to create a generic CSP system with C# (or F# for that matter). I've built similar systems using WCF.
- Paradigma11 12y agoDoesn't rx fill that role?
- 12y ago
- katbyte 12y agoI'd like to add extension methods & default parameters to your list. Being able to extend any object with new methods has made programming in C# much more pleasurable then most languages I've used.
- aerique 12y agoThanks for your extensive answer.
- pjc50 12y agomultiple competing event loops for instance Fortunately Windows has implemented message-passing event loops for you for a couple of decades. And they're pleasant to work with as long as you don't mind everything being a WPARAM/LPARAM.
- nbevans 12y agoThose type of event loops are for Win32 API GUI applications. Server applications like a async socket server use IOCP, a kernel based type of event loop that is highly performant and scalable. And by the way, the .NET CLR already uses them at its core for sockets and other types of I/O.
- tkubacki 12y agoDartlang also will get C# style await async (as of 1.8) and has very similiar syntax. Additionaly it has more CLI oriented tools (eg. pub) and Google ecosystem integration (recent app engine managed vms integration) I'm happy .NET is going open source path but still think we need others to compete.
- 72deluxe 12y agoAre Strings a separate entity to built-in types like they are in Java? If so, I find that behaviour odd and welcome C++'s "a user-defined type is not different to a built-in type" approach