11 ms·
Definitely agree with you on C#. It feels like this is what a standard, mature, widespread language should be. There are other languages that are better for spe
by hackinthebochs 15y ago
Definitely agree with you on C#. It feels like this is what a standard, mature, widespread language should be. There are other languages that are better for specific tasks, but for the general programming language, C# really hits the sweet spot in terms of features, expressability, readability, and environment. This is the language that Java should have been--could have been.
Also, I dread getting asked on my next interview "whats the one thing you don't like about your favorite language". I honestly can't think of anything off the top of my head. Granted, I've come across things that were frustrating at various times, but they never stick in my mind. I think that's a testament to how well the language has evolved.
- MartinCron 15y agowhats the one thing you don't like about your favorite language That's easy. So many hacker types dismiss you as some sort of weirdo for favoring anything that came from Microsoft.
- redthrowaway 15y agoOr, less glibly, it's a mostly single-platform language with support for other operating systems offered only through third-party tools.
- megamark16 15y agoI don't dismiss C# developers, I'm just glad I'm not one anymore.
- MartinCron 15y agoDo you mind if I ask why? Not being defensive, just curious.
- llimllib 15y agoWell, I'm not the gp, but I am a former C# guy who's happy to be out of that world. 1) I dislike C#'s types; they're neither as strong and intelligent as a ML/Haskell language nor as convenient as a Python/Ruby family language. 2) I much prefer the sense of design displayed by Python and Ruby open source projects over C#. (Not that there aren't issues there!) 3) I hate Visual Studio. Nice debugger, crappy interface for writing code. Horrific user interface design for the most part. (At least back when I was writing C# back in 2009!) 4) I hate Windows. Linux and Mac are far more developer friendly. I hated dealing with Cygwin to get some sort of reasonable (crappy but tolerable) command line environment. 5) I love git. Until fairly recently, git was not available and stable on Windows. For it and for many other bits of software, windows is a second class citizen. Shall I go on? Because I could. But I'll leave it at 5 for now.
- MartinCron 15y agoThanks for the thoughtful reply. I've absolutely felt your pain. Some of those things have maybe improved (I use git every day, I love my PowerShell, and Visual Studio + ReSharper is glorious once you tell some of the cruft to stay out of your way) but it's still a long way from perfect.
- DaveMebs 15y agoIt's amazing how many people either dismiss PowerShell out of hand because it's different, or don't even think about it when talking about Windows commandline support. Getting .NET objects returned, rather than piping text around is awesome. So is having an IDE specifically for writing PowerShell scripts. I'm still learning PowerShell, and love bash, but as powerful as bash is, in some ways it feels very primitive in comparison. If PowerShell 15 years old when bash was released, would anyone consider it better than PowerShell?
- llimllib 15y agoPowershell did not exist when I was a C# programmer. Not saying it would have made a difference either way, just that I couldn't have mentioned it. Anyway, I don't think bash/zsh is so great, rather the tools that have grown around them for the last 20 years make them the best available option. Powershell may be nice, but it's got a long road to hoe.
- tomjen3 15y agoThat is easy -- non nullable objects. What I mean by that is that you can already specify that some numbers may be nullable. I would love to be able to specify that some objects cannot be null and have the type-checker verify it. Even better I would have an option type so that you never need to use null, ever.
- hackinthebochs 15y agoThat's a good one, I'll keep that in mind. (I'm not just cribbing, I ran into a real world situation that just screamed non-nullable objects).
- nikolaplejic 15y agoThey don't really work at the type system level, but Code Contracts (http://msdn.microsoft.com/en-us/devlabs/dd491992 http://msdn.microsoft.com/en-us/devlabs/dd491992), though quite verbose, may be used to achieve that to a certain degree. The integration with Visual Studio is decent and the documentation is great, but they are designed to provide a whole design-by-contract framework which may be an overkill.
- pbz 15y agoI remember Anders saying that that was one of his regrets for not implementing this from the beginning. According to him adding this now would break quite a few things, but he hasn't yet given up on the idea.
- zmj 15y agoI agree in large, but there are some rough edges. -It's wordy. The var keyword was a step in the right direction, but there's still a lot of redundant type information, even compared to other statically typed languages like Go or F#. -Legacy code. A lot of things that are concise and easy in C# 3.5+ were possible but hideous in older versions. Sadly, that code must still be maintained. -Null handling. Like another commenter, I wish the language would help more with null values. I'd love an operator to do monadic null coalescing: var foo = thing1.thing2.thing3.bar; Sometimes I want foo to be null if any of the chained objects are null. It's a pretty good language, though. I'm looking forward to the Roslyn API to the compiler: http://msdn.microsoft.com/en-us/hh500769 http://msdn.microsoft.com/en-us/hh500769
- skrebbel 15y agoLegacy code is a problem in every language. Whether the language evolves, or just the common insights of how to use it best. In fact, C# deals excellently with legacy code. While, unlike the JVM, .NET is not binary backward compatible (allowing some excellent language improvements that Java still has not managed to pull off), it is nearly (but not entirely) source code backward compatible. Sure, this allows to old code using old constructs to stay alive, but it works. That alone is pretty unique, especially if you see that nearly any other language either does not manage to move its community to the next version with breaking changes (Python 3, PHP 6) or has tons of compatibility issues every time something changes (Ruby, Scala), or simply is at a standstill (Java). Having to deal with a DictionaryBase child class which was made before generics were added is way less of a deal than not being able to upgrade your software to the newest version of the language at all. Which is what would've happened if this was done like Scala. Or, if it was done like Java, we'd still be hacking DictionaryBase child classes. I'd maintain that no language/platform deals with legacy code better than C#.
- mquander 15y agoC# programmer for a couple years, and I think C# is OK (it's definitely way ahead of Java or C++) but I've definitely got a big list of things I don't like about it. The top of it reads: - Events and properties aren't first-class, which is lame. I can't even easily get the "get" or "set" method of a property without either using reflection or making a wrapper lambda. - No syntax sugar for tuples. - No syntax sugar for destructuring anything. Come on now. - The type system has big holes. For example, I still can't specify class Something<T> where T : new(T) (i.e. where a copy constructor exists on T.) And I can't specify class Something<T> where T : /* is a numeric type */. - It would be nice if there were type inference on more things, like property and field types. - All reference types are nullable which sucks.
- hackinthebochs 15y agoYour list basically boils down to "C# isn't <insert favorite language>". Which is fair of course, but most of your list wouldn't really make sense in C#.
- jbrechtel 15y agoWhy would sugared destructuring not make sense in C#? Or first class events and delegates?
- hackinthebochs 15y agoDestructuring just doesn't fit with the current language syntax. There are no copy constructors in C#, so something like [a, [b, c]] = [1, [2, 3]] makes no sense syntactically. In languages where declaring objects don't require a new, this syntax follows naturally. For the simple case of say, destructuring a tuple, that could work well: a, b = ReturnsATuple(). But anything more general would just seem tacked onto the language. But then again, tuples don't really fit well in C# either! Tuples are only useful if you don't have to declare their types, ever. Without full type inference, nothing is saved by using tuples over, say, an inline object. I don't understand the significance of first class events, so I can't really comment on that. And as far as I know, delegates are first class now with the inclusion of lambdas.
- frou_dh 15y agoYep. To me C# feels like the standout all-round language. It's not super-elegant, but it's modern and brings together a lot of useful features without messing up much. I especially like the stuff that was added in v3.0. On design alone, I would probably vote Clojure. The features and their rationale are very compelling.
- loudmax 15y ago<i>I honestly can't think of anything off the top of my head.</i> Limited support in the open source ecosystem? Open source projects are reluctant to build on something that might infringe on an MS patent. That's what keeps me away from the language. To be fair, this is more an indictment of the patent system than C# itself.
- hackinthebochs 15y agoI was thinking more along the lines of the language itself. Complaints about the (lack of) open source ecosystem are more than valid. That's something I dearly miss in the .Net world.