Live data from Hacker News

Why Java Now Rocks More Than Ever: Part 1 – The Java Compiler

zeroturnaround.com

121–130 of 149 posts

Re: Why Java Now Rocks More Than Ever: Part 1 – The Java Compiler

#121

Earlier quoted context omitted.

> I don't find Java that verbose (especially with lambda functions in Java 8). Honestly: use something better for a while and come back and say that. Java is verbose. There is a ton of ceremony around anything in it, from ill-considered defaults that require lots of specification (see Scala's remarkable ability to strip bullshit out of its equivalent to Java code) to the cultural design-pattern mess. It's a lowest-co…

> the cultural design-pattern mess. While it may have become cultural, the design-pattern mess is directly related to the limitations of Java the language when applied in its typical domains of application. The reason many languages whose features evolved in light of the Java design pattern mess don't share that mess isn't purely cultural, it is because the features of those languages were designed specifically (ofte…

> While it may have become cultural, the design-pattern mess is directly related to the limitations of Java the language when applied in its typical domains of application.

Totally agreed, I definitely elided some stuff there. They definitely exist to get around limitations in Java's expressiveness, and I cringe every time I end up writing them (day job is Android, and Scala there is iffy at best).

Re: Why Java Now Rocks More Than Ever: Part 1 – The Java Compiler

#122
post #19
post #14

Java is rapidly becoming more viable as an alternative to all of these "trendy" languages these days, e.g. Ruby, Python, Go. What I mean by that is simply that a lot of developers are prejudicious against Java due to historically it being slow and having tedious development feedback cycles. We use Java extensively (and Java EE 6) in an agile IT business and it is truly an asset. I encourage others to look in the dire…

+1 Convention over configuration, scaffolding similar to RoR (or better with Forge) and advanced meta-programming via annotations have reduced the effort to produce CRUD applications to a level similar to the trendy languages and frameworks. While J2EE was painful (10 interfaces and classes for some Entitys), JavaEE is fun to work with and (for the most part) intuitive as it's focused on POJOs and includes DI (CDI).…

So true - enjoying working with Java EE on a daily basis. I am not always entirely satisfied with Glassfish though (my application server of choice), so I'm willing to consider others. What are you using, perhaps JBoss?

Re: Why Java Now Rocks More Than Ever: Part 1 – The Java Compiler

#123

> All this is only worsened by the ‘black box’ nature of the optimization level switches. JVM switches like -XX:CMSInitiatingOccupancyFraction=70 -XX:SurvivorRatio=2 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:NewSize=2048m -XX:MaxNewSize=2048m (taken from real recommended settings for an open-source project) are, of course, not opaque-to-the-average-user at all :)

If you're using the new G1 collector which ships in JDK 7, the only configuration parameters you really need to care about are the minimum and maximum heap sizes (-Xms and -Xmx) and perhaps the latency target (-XX:MaxGCPauseMillis). So it's not all bad.

Well, this is the theory, certainly :) I haven't found it to necessarily be true in all cases.

Re: Why Java Now Rocks More Than Ever: Part 1 – The Java Compiler

#124

Earlier quoted context omitted.

> Honestly: use something better for a while and come back and say that. I've written code in about 20 different languages. What language features / lack of features do you think make Java verbose? I found Scala complex and ugly (and I'm not alone), much slower to compile than Java and Java has better tooling.

- No pattern matching. This alone basically makes the rest of this list just piling on; once you have 'gotten' pattern matching, Java (and, to be fair, most other popular languages) becomes intolerable. - Lack of even halfassedly reified generics means you're throwing Class objects around everywhere for no good reason. (Scala adds manifests as implicit parameters and it's not as good as .NET but it's a hell of a lot…

- Type erasure - true but it results in a very small increase in overall verbosity.

- Null - true but Scala's approach is perhaps more verbose than Java's. I like Groovy's approach the most ().

- Functional if - definitely disagree that it makes tons of code simpler / easier to read.

- Java 8 has traits (but I'm not sure if they're equivalent to Scala's traits).

- Nonfunctional core API's – Guava helps here.

– Reference-reseating-by-default - don't know what you mean by that.

I don't think Scala is the next Java. Personally, I wish Kotlin, Ceylon or Dart would replace Java. Scala makes the wrong expressivness / simplicity tradeoff.

> outside of the epistemic closure of the Java world it is rapidly becoming understood that Java is better at nothing by design

Not true. Yammer moved back from Scala to Java: http://blog.joda.org/2011/11/real-life-scala-feedback-from-y...

Re: Why Java Now Rocks More Than Ever: Part 1 – The Java Compiler

#125
post #88

Earlier quoted context omitted.

I like working with Java too. I'm only pointing out the problems, which I see are pretty clear. The only problem is from the perspective of using and developing a new skill, I would rather use a newer language which is better built for problems of our time than something 20 years back. Java has had its day in the sun. Its primary purpose was to become an easy C++ for people who didn't get memory management and people…

Ok, what language would you suggest as an alternative? I've written code in lots of different languages and I haven't found a replacement yet (C# is closest, but I mostly do Android development, on Linux).

As someone suggested earlier, Scala is probably the best option for a Java developer looking for an alternative. Runs in the JVM, is compatible with Java programs, mixes OOP and functional programming. It can be summarized as "Java meets Haskell".

What I found liberating in Scala is a simple proposition: "use OOP when it makes sense, and functional programming when it makes sense". It's wonderful when you don't have to reason about everything using the OOP lenses and you get to choose, very empowering.

Your criticism to Scala in the other comment seems to amount to "it's not Java", which is extremely weak as an argument. If you are looking for an exact duplicate of Java, then just use Java. Scala is more complex than Java, certainly, because it gives you more options and also because it has a way of rewarding those who master the language. And "ugliness" is a completely subjective matter, I find Java with all its boilerplate ugly and not Scala, for example.

Re: Why Java Now Rocks More Than Ever: Part 1 – The Java Compiler

#126

> All this is only worsened by the ‘black box’ nature of the optimization level switches. JVM switches like -XX:CMSInitiatingOccupancyFraction=70 -XX:SurvivorRatio=2 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:NewSize=2048m -XX:MaxNewSize=2048m (taken from real recommended settings for an open-source project) are, of course, not opaque-to-the-average-user at all :)

By the way, I'm not complaining about Java here. I _like_ Java (or at least I like the JVM; the language is something one puts up with, or sometimes not, for the JVM). I just don't think it's terribly fair to say that c compilers require all these arcane options for performance, without noting that JVMs have their own just-as-arcane (or maybe moreso; garbage collection is harder to wrap your head around than compiler optimisation, and can hurt you more) options which are required for performance.

Re: Why Java Now Rocks More Than Ever: Part 1 – The Java Compiler

#127
Java is the definition of enterprise level language. Very newbie friendly. It's nice for the newbies but it's verbosity and small set of features kills it for any experienced programmer.

Please don't tell me about the fabled Java 8. Google doesn't care about new java versions, so we are stuck with Java 6. Most people will move to other languages until Java 8 gains any traction.

Re: Why Java Now Rocks More Than Ever: Part 1 – The Java Compiler

#128
post #64

One of the things I see with Java today, how difficult things have gotten with the language. Its next impossible to deal with any large Java project without an IDE. The verbosity of the code is mind boggling. Often method calls are 4 - 6 layers deep, which in itself makes is very difficult to remember or even implement even if you read the documentation well. The resulting code is massive walls of text. 90% of that i…

> Often method calls are 4 - 6 layers deep

This is hardly the fault of the language, more of the community, which tends to fetishise certain patterns a bit.

Re: Why Java Now Rocks More Than Ever: Part 1 – The Java Compiler

#129

Earlier quoted context omitted.

- No pattern matching. This alone basically makes the rest of this list just piling on; once you have 'gotten' pattern matching, Java (and, to be fair, most other popular languages) becomes intolerable. - Lack of even halfassedly reified generics means you're throwing Class objects around everywhere for no good reason. (Scala adds manifests as implicit parameters and it's not as good as .NET but it's a hell of a lot…

- Type erasure - true but it results in a very small increase in overall verbosity. - Null - true but Scala's approach is perhaps more verbose than Java's. I like Groovy's approach the most (). - Functional if - definitely disagree that it makes tons of code simpler / easier to read. - Java 8 has traits (but I'm not sure if they're equivalent to Scala's traits). - Nonfunctional core API's – Guava helps here. – Refere…

Yammer did no such thing (and it's telling that you're sourcing a two-year-old article that misrepresents the situation under discussion): http://eng.yammer.com/scala-at-yammer/

And Scala isn't the next Java. Frankly, it isn't simple enough to appeal to people who have become comfortable; it isn't unchallenging enough to supplant Java. This is not a demerit.

Re: Why Java Now Rocks More Than Ever: Part 1 – The Java Compiler

#130

Earlier quoted context omitted.

Ok, what language would you suggest as an alternative? I've written code in lots of different languages and I haven't found a replacement yet (C# is closest, but I mostly do Android development, on Linux).

As someone suggested earlier, Scala is probably the best option for a Java developer looking for an alternative. Runs in the JVM, is compatible with Java programs, mixes OOP and functional programming. It can be summarized as "Java meets Haskell". What I found liberating in Scala is a simple proposition: "use OOP when it makes sense, and functional programming when it makes sense". It's wonderful when you don't have…

> Your criticism to Scala in the other comment seems to amount to "it's not Java"

It amounts to "Scala is too complex, ugly and slow to compile."

Yammer moved from Scala to Java BTW: http://blog.joda.org/2011/11/real-life-scala-feedback-from-y...

My ideal language would be some mix of Kotlin, Ceylon, Dart and Julia.

Post reply on HN