In podcast 73, Joel Spolsky and Jeff Atwood discuss, among other subjects, "five things everyone should hate about their favorite programming language":
If you’re happy with your current tool chain, then there’s no reason you need to switch. However, if you can’t list five things you hate about your favorite programming language, then I argue you don’t know it well enough yet to judge. It’s good to be aware of the alternatives, and have a healthy critical eye for whatever it is you’re using.
Being curious, I asked this question to any candidate I interviewed. None of them were able to quote at least one thing they hate about C#¹.
Why? What's so difficult in this question? It is because of the stressful context of the interview that this question is impossible to answer by the interviewees?
Is there something about this question which makes it bad for an interview?
Obviously, it doesn't mean that C# is perfect. I have myself a list of five things I hate about C#:
The lack of variable number of types in generics (similar to
Action<T1, T2, T3>,
Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>
The lack of support for units of measure, like in F#.
The lack of read only properties. Writing a backing
private readonlyfield every time I want a read only property is boring.
The lack of properties with default values. And yes, I know that I can initialize them in the parameterless constructor and call it from all other constructors. But I don't want to.
Multiple inheritance. Yes, it causes confusion and you don't need it in most cases. It's still useful in some (very rare) cases, and the confusion applies as well (and was solved in C#) to the class which inherits several interfaces which contain methods with the same name.
I'm pretty sure that this list is far from being complete, and there are much more points to highlight, and especially much better ones than mine.
¹ A few people criticized some assemblies in .NET Framework or the lack of some libraries in the framework or criticized the CLR. This doesn't count, since the question was about the language itself, and while I could potentially accept an answer about something negative in the core of .NET Framework (for example something like the fact that there is no common interface for
TryParse, so if you want to parse a string to several types, you have to repeat yourself for every type), an answer about JSON or WCF is completely off-topic.