Hacker News new | past | comments | ask | show | jobs | submit login

There's very little reason not to upgrade to Java 8. Generally things just work. With Java 11 generally things just break, so it's completely another matter. I think that Java 8/11 will repeat Python 2/3 story.

> There's very little reason not to upgrade to Java 8

Depending on a pre-compiled jar that is not compatible with Java 8 :(

We are moving to Java 8.

There is a special place in my heart to hate the new shiny lambdas. Makes code too difficult for reading, nowhere compatible when needing to use Java 7 every now and then.

With the article would just disagree on Sharepoint, would say Confluence has finally replaced that one.

I'm curious, do you really prefer anonymous classes over lambdas? To me, anonymous classes are much more annoying to read.

Or are you just saying that lambdas are as bad as anonymous classes?

IntelliJ IDEA actually just collapses them into lambdas by default. And it also auto-generates them for you so you don't have to type them. At least that was the state of things a couple of years ago, can only have gotten even better since then.

Do you really prefer a language to not have higher order functions than with them?

Quick, what does this do (in Scala)?

(1 to 100).map(x => x * x).reduce(_ + _) ?

Or if you don't like the underscores we could make it more explicit:

(1 to 100).map(x => x * x).reduce {case (x, y) => x + y }

Let's look at the iterative alternative:

var (i, sum) = (0, 0)

while (i < 100) { sum = i * i; i = i + 1 }

You could argue about performance or whatever, but closures are safer, more powerful, easier to read, and more concise.

Using a language without anonymous closures is like programming blind-folded and with one hand behind your back. It's pretty much the definition of Paul Graham's "Blub" languages[1]

Of course, classes are closures and closures are classes. But classes without closures are verbose, stupid, and ugly.


  sum = (1 to 100).map(x => x * x).reduce {case (x, y) => x + y }

  sum = 0
  for i in 1..100 { sum += i * i }
I personally find the second one easier to understand. Performance is much better unless the compiler does some magic to convert the first version to the second one.

Adding more logic to the loop also doesn't make the code more complex.

Yeah, I agree as far as reading it goes when you switch between different projects using different versions. I do like using the Stream API though.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact