Mike Lee takes Cocoa and Objective-C to task for a lot of cruft, inelegance and/or inconsistency.
The article is a good read. I agree with almost every specific point he makes. However:
When I begged, I begged with PHP, ASP, SQL, XSL, JavaScript, Java, and even shudder C# .Net. When I chose, I chose Cocoa.
Which is funny because later on he asks for autoboxing and generics, calling them out as Java features; things he miss from Java. You know that C# language that makes you shudder? It had autoboxing from the get-go and added generics later, and its implementation of each of these features kick some major Java ass.
In Java, only primitive types get to be value types; so when you use Integer (the boxed counterpart of int), your program might go boom if you use this line: int x = foo(); if your foo method returns an Integer and that happens to be null. This doesn’t happen in C# because autoboxing was built-in from the start, because the autoboxing is so good you just think int is syntactical sugar for System.Int32, and because System.Int32 is a struct, which is allowed to be a value type, and can’t be assigned null. (Java doesn’t have structs.)
In Java, the generics metadata is stripped away as soon as possible during the compiler stage to generate compatible bytecode. Which makes sort of sense. But weren’t we supposed to be able to reflect the hell out of this language? (And of course, in C#, the bytecode is incompatible, but generics has glorious support. Also, you can specify constraints for the types.)
What really ticks me off with Java, despite that I get along reasonably well with it, is that it’s got absolutely no aspirations to be anything other than a slowly-growing (community process! community process! squawk!) C++ implementation with a better syntax, a no-magic-allowed attitude (if it’s implemented like a method in the bytecode, by gum, it should be written like a method in the code!) and the same inherit-once-implement-n-times model C# and Objective-C uses. People are still bickering about adding closures, and things that are genuinely useful and eventually do get added don’t get all-out support because hey, that might break the bytecode.
.NET itself is largely a festering spectre. C#, though, is perhaps heavy, but it’s certainly well designed. If the past few years of how the language has evolved has taught us anything, it’s that you should never, ever, underestimate Anders Hejlsberg. He just might be Denmark’s way of making up for Bjarne Stroustrup.