-4

I have some projects in Java 6 and Spring on app server. Because of limitations in my infrastructure and governance planninng I cannot migrate to newer Java 7 or 8.

I think i could add Kotlin in those projects to use features like functional programming.

It this approach a good way to go?

Thanks

Sartorius
  • 499
  • 5
  • 12
  • 2
    It would really help to know more about your "limitations". In general, I'd say give Kotlin a try. Better stay away from `lambdaj` (suggested in one of the answers) - IMHO, it's really ugly (and outdated). If Kotlin doesn't work for you there are still better alternatives, e.g. [retrolambda](https://github.com/orfjackal/retrolambda) and either [streamsupport](https://sourceforge.net/projects/streamsupport/) or [LWS](https://github.com/aNNiMON/Lightweight-Stream-API) – Sartorius Oct 13 '17 at 20:20

2 Answers2

2

In my opinion Kotlin is a great language because it addresses all the pain points from Java in terms of boiler plate code and adds all of this plus functional programming to Java 6 (your target Java version)

So go ahead and give it a try. If you use IntelliJ you can convert Java files to Kotlin and vice versa.

Simon Martinelli
  • 34,053
  • 5
  • 48
  • 82
1

For kotlin, I don't know. But I think there is a lambda library, developed by Mario Fusco, an italian "Java Champion" (the only italian Java champion as far as I know), which is named lambdaj. I google it for you and I found this. I suggest you to google it a bit more, I remember that long time ago it was available in a jar for ant build.

I hope it helps.

marco
  • 671
  • 6
  • 22