*I first typed my response to your comments, but it looks that it became more of a rant about the current state of the Java ecosystem. So nothing against you, clay, your response just caused me to vent my deep frustration about the willfull ignorance, the anti-intellectualism, and the denial of reality which has spread through some parts of the Java ecosystem.*
I think everyone would agree that Java has been very slow to evolve > relative to just about everything else. > However, Is the CLR ahead of the JVM? Really? Is C# ahead of Java? How so? > Yes, feature-wise they are years apart (unified type system, meta-object protocol, tail calls, generics, assembly system, ...). HotSpot's garbage collector is way more sophisticated, as well as HotSpot's JIT compiler. Sadly, those don't really translate into any clear performance benefits, because .NET's approach is completely different in this regard: Their language features/compiler are designed to do most of the work upfront, so their JIT compiler has to do magnitudes less: For instance, the whole notion of dynamic recompilation doesn't exist in the CLR. Their JITter runs once, before execution, that's it. (It can also run AOT.) As another example, their implementation of Generics might make it hard for alternative languages to run on the CLR and interface with existing assemblies, but from a performance/memory point of view it combines the strength of C++'s model with the advantages of having a runtime to generate the appropriate specializations on demand. (Scala can do some specialization at compile-time, but without any help from the JVM it is painful, bug-prone and complicated to actually manage to trigger the JVM's fast path. The .NET/language team has managed -- by carefully designing their language to not require extensive runtime-analysis -- to avoid the need for sophisticated runtime services (compared to the JVM) to achieve more or less comparable performance and a lot less memory consumption. Generally, if running Eclipse on top of IKVM on top of the CLR has lower memory consumption AND faster startup time than "the usual way" and this is not even raising the eye brow of the "Java community" I really wonder what can ... The big important features that C# has that Java 7 lacks are already in > Java 8: concise, first class functions, functional enhancements to > collections, sane date/time api. I suspect Java 8 might even leap frog C# > on the latter two items. > There is a lot more to it (properties, type inference, better Generics and associated overloading/inheritance, tuples, unsigned numbers, better native interop and tons of other stuff). Considering the last two: C# had those collection methods for years already and has put them to great usage (LINQ), while Java will only get the most basic implementation at the end of 2013 (which will be basically useless for implementing some LINQ-style abstraction). The Date&Time stuff will be an improvement over the available libraries on .NET, though. > C# has other small plusses over Java that I like, but they aren't deal > breakers: multi-line string literals, no checked exceptions, value types > aka structs, better handling of nullable primitives, declaration side > covariance/contravariance of generic classes (where generic types are > declared as in/out). Output parameters are also a small plus. > The non-existance of structs is one of the reasons (the need for complex GC/JIT/optimizer infrastructure is another one) why Java is such a memory hog (which is one of the major complaint of people having to use stuff written for the JVM). Also, it is crippling all the data structure implementations: Either you implement your data structure in terms of arrays or you will suffer from the 20/80 split (20% data, 80% overhead). Even worse, this is an issue no JIT compiler can solve. > On the flip side, as far as language features and elegance go, Scala > really trumps both Java and C# by a large margin. > I praise your optimism, but if I see how some "senior Java developers" which never used the language start hyperventilating in their blog posts as soon as someone mentions Scala, and how every three months a new "slightly improved, slightly different Java" is announced with great fanfare (and failing to deliver anything valuable afterwards) I'm not sure many people in the Java community have realized this. For some people, Scala is great when they can show that their ecosystem is not ten years behind .NET, but as soon as senior developers feel that their "seniority" is threatened they get _very_ angry about the language. First the usual "OMG Java Joe will NEVER understand this!!!!!!" (although .NET developers have coped with magnitudes higher complexity (look at C#, just look at it; or read the spec if you don't believe me)). Then the bogus "OMG, I found a method signature I don't understand" while failing to mention that achieving the same semantics in Java is just completely impossible (and would probably require bytecode assembly, annotation preprocessing or hacking javac itself). Also, I like the culture/community of the JVM far more than that of the > .NET. The JVM has a more open, academic like culture, where people > constantly debate and choose what they feel is the best product > language/ide/build tool/test framework/web framework/etc. > I don't see much of this anymore. I guess the constant anti-intellectualism drove many people away. The .NET side at least listens to their language designers and engineers ... just look at F#. The newest version will revolutionize the way developers will be able to use external data sources like databases and web services. If they will decide to integrate it in C# too, it will be a black day for the whole Java ecosystem. Even NET's current line-up of libraries and tools, the whole out-of-the-box experience is years ahead of the state of the art in the Java ecosystem. On the Java side, we have bizarro bullshit approaches like JDBC, raw SQL, code generation, JPA, and a ton of other ugly, half-assed non-solutions to problems which shouldn't have existed in the first place. On the .NET side, there is more unquestionable loyalty to everything > Microsoft. > At least they manage to ship things in time, not ten years late. Even if the current Java stewards would actually decide to work on Java/the JVM again, I see no way they wouldn't spend the next ten years playing catch-up (just look at their roadmap if you want to get depressed). Compare that to what's happening in .NET currently: async in C#/F#, the whole Roslyn project or F# type providers. Maybe the Java community really needs some "the platform is burning" memo to wake up, stop their self-congratulatory circle-jerk, look at what's happening outside their bubble and decide to start working again on stuff that actually matters. (To those people you will immediately respond with something along the lines of "but Java is the most popular language", "look at TIOBE" or "Java will be used for ever": you're missing the point, completely.) I really hope this can be turned around, and I'm counting on you guys! :-) -- You received this message because you are subscribed to the Google Groups "Java Posse" group. To view this discussion on the web visit https://groups.google.com/d/msg/javaposse/-/w8mGSOfa1JcJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
