I think Java suffers from too many search results (yes thats a thing). I suppose if you want to learn Java today you simply google it, and find tons of people trying to solve the N+1 hibernate problem on stackoverflow, or some other common annoying enterprisey issue, and so you start reading up on JCPs and EE apis. If that is your introduction, I can understand why people end up going "what is this shit?". The reality of course is that there are many subcultures within the Java community and that many of them are anti cruft api as well which is how innovation comes to the Java world.
For example, if someone put as much effort in .Net's original collections API as they did with Java JCF, many a facepalm would have been avoided.
To be honest the whole JSR process is usually hindered by shoddy implementations rather than fundamental problems.
Just because Java requires explicit typing all over the place does not make it easy to read, especially when I'm trying to decipher what the ResourceBuilderFactoryFactory class is doing in my enterprise grade codebase. There is cognitive load in parsing tons of text to express simple concepts, just as there is cognitive load in deciphering a bunch of random symbols doing something complex. Scala with discipline lets you choose somewhere in between; Java gives no choice.
That has nothing to do with language; Java for which development is outsourced and maintenance goes in house is pretty much a nightmare, too.
But that's pretty much a "myopic development practices -- including outsourcing development of code you are going to need to end up supporting in house -- will blow up in your face problem", and not an issue relating to any particular language or platform.
Chances are, if you have the authority to make enterprise-level language/platform policies, you also have the authority to make enterprise-level decisions on whether and when to outsource development of software, so it makes sense to just do the latter right than to make an otherwise second-rate choice on the former to make up for doing the latter poorly.
If code is becoming unmaintainable because of outsourced development, does that not have more to do with how we communicate to these external developers? Bad code is bad code in any language.
As far as the rest, we'll just have to disagree, I stated up front that it was an opinion :)
No one uses the strict mode stuff except those unwittingly beta testing it for Grails. It was written by one lone programmer and is still buggy.
So, there's consensus that this feature is not ready for prime time? (I don't want an answer from people who hate Groovy in general)
Best wait till Grails trusts the static enough to use it before you do.
> I don't want an answer from people who hate Groovy in general
I love the Groovy Language, but the current PM made some bad decisions after taking over, e.g. removing Poirier's Heredocs, disabling Scala-like catchless try statements, laundering Tkachman's Groovy++ static-typing plugin, stonewalling on Wilson's MOP upgrade, scuttling any attempt to spec the language, the horrible paren-less DSL syntax for multi-arg function calls, removing Closure Lists just before an RC release without any public discussion, how Strachan the founder was knifed over dynamically-scoped closure syntax at Devcon 2, how Java 8 lambda retrofit hasn't even been begun on, instead the PM is wasting time on non-Java compatible traits to Groovy, etc.
I still love the essence of the Groovy Language, tho, that's why I'm rebuilding it atop Clojure.
I'm a bit skeptical of this claim. While Java does remove many of the opportunities other languages provide for making a small piece of code do something unexpected, I've found that Java's verbosity makes it hard to see the big picture.
Of course, good programmers manage in spite of any limitations of the language, and bad programmers manage to write incomprehensible code no matter how much a given tool tries to guide them in the right direction. I suspect it will always be this way, and that's not a bad thing.
It's still unbelievable to me that so many shops drank that Kool-Aid.
You don't have to use funny operator overloads if you use scala! Making your code readable in that language is definitely up to the developer.
Thats what I've been thinking (and posting) since some time now, nice to see I'm not the only one. I know some Startups regretted choosing Scala.
As for clojure, how does its performance compare to groovy?
Really interested to know more!
That said, an idiomatic system in Clojure will likely have a very different design than it would in Groovy or Java. Using Clojure's built-in immutable data structures, it's cheap in terms of CPU and memory to make a large number of modified copies or to concurrently access data compared to the standard collections in Java and Groovy. Single-threaded reading and writing are, however somewhat more expensive.
My prediction is that it's easier to get good performance out of a system with a lot of concurrency using Clojure than it is with Groovy or Java, though with careful design, it's possible to get better performance with Java.
> lots of additional syntax for collection manipulation
Actually using collections in Scala is far more easier than in Java
And i'm not even talking about XML parsing... where you would write 30 lines in java you'll write one liners in Scala. Guess which one is easier to read...
Scala promotes immutability that make code sane.
Scala promotes recursion over loops that makes the code elegant.
Scala promotes experimentation through its REPL.
Scala saves you writing 75% of the java boilerplate, thus promotes maintainable applications.
Scala looking much like Java is a deception but also an necessity for compatibility which Java libs. but the syntax has a total different meaning . That's the genius of Scala. Scala is the guy looking outside the box when Java is trapped in Cargo Culting.
Scala is the future of the JVM.
Specifically, the point about encouraging recursion for more 'elegance' kinda bugs me there. Recursion is more of a natural fit than loops when walking a tree or graph, and is less so when iterating a list, set or map. It's about practicality.
If you're very interested in aesthetics, you'll never like java or even not-hate it. And that's ok.
The fact that Scala can look a lot like Java is more for compatibility with Java devs; the code could look a lot different (and idiomatic Scala does) and still be compatible with Scala libs, but supporting code that is familiar to Java devs eases the learning process and encourages adoption.
Groovy is slow as a 1-legged dog. (we use it to fill the shell/perl niche a lot but it is slow, effectively you're doing reflection lookups every time you call a method in Groovy). The dynamicness makes it better for scripting or web programming, though, where you don't care as much about performance.
Scala is the JVM's C++, a giant pile of overlapping features, supported by an advanced and very slow compiler that yields fast bytecode. Case classes, funny operator overloading, lots of additional syntax for collection manipulation. They're giving you more expressiveness at a cost of readability and language complexity. (This is an opinion, some may disagree).
Clojure is really awesome but most dev shops will have an easier time with imperative programming models.
Ultimately, not changing in 8 years isn't fundamentally bad, and Java isn't that bad at all as a language if you avoid things like EJB and Hibernate, and if you're not looking for a dynamic language like Ruby and dissapointed by Java not being Ruby. You might just disagree with the tradeoffs.