6 ms·
I like C#. There are two reasons why I don't use it more. First, the whole .NET thing (Or rather, the lack of cross-platform compatibility). Yes, Mono is prett
by TheLoneWolfling 11y ago
I like C#. There are two reasons why I don't use it more.
First, the whole .NET thing (Or rather, the lack of cross-platform compatibility). Yes, Mono is pretty good, but nowhere near perfect. (Although note that this is changing).
And second, enums are hideous in C#. One of the few things Java does better than C#.
- nvivo 11y agoThat's funny. Enums are one of the things I believe C# got better than java.
- TheLoneWolfling 11y agoElaborate? I find it really annoying that C# enums cannot have constructors and variables.
- nvivo 11y agoThat's exactly the point. Enums are just enumerations, they're not classes. It makes little sense in my opinion to add constructors and variables to enums. You can do exactly what java calls enums with classes in C#, which in my view are better suited to having constructors and fields. But I agree it's all preferences.
- TheLoneWolfling 11y ago> You can do exactly what java calls enums with classes in C# No you cannot. You lose the single biggest benefit of enumerations - namely compile-time checking. (For instance: warning when a switch statement does not cover all cases.) Try to do this in C#, and you'll see what I mean: http://snipplr.com/view/42422/the-planet-enum-example/ http://snipplr.com/view/42422/the-planet-enum-example/. Either you end up with it being ~3x as verbose (if not more), or you lose the compile-time benefits, or both.