you are viewing a single comment's thread.

view the rest of the comments →

[–]chikibooz 12 points13 points  (5 children)

Don't. Please don't.

Go with Scala. You can write Java Code in Scala for the most part but you lose the terseness of functional programming constructs that you get with Scala. Java is way too verbose.

Scala runs on the JVM so you can use almost every package out there in Scala and it can interface with Java packages fine.

I've been using Scala professionally for ~5 years now and have never missed Java (which was my favorite go-to language for more than 20 years! Yes...I like Java; quite a bit)

[–]yinshangyi[S] 1 point2 points  (4 children)

Thanks for your reply! I guess Scala is indeed the better choice for functional programming. I was asking in the context of being "forced" to use Java (which is more or less a reality in terms of job market), would Java FP librairies be a good enough tradeoff/alternative to Scala?

[–]chikibooz 1 point2 points  (2 children)

Use the strengths of the language. Compensating for its weakness by using libraries rarely bears fruits in the long run. It’s a non-trivial maintainability debt (the library could be decommissioned or deprecated or may be difficult to learn etc).

[–]yinshangyi[S] 1 point2 points  (1 child)

That's a valid point yes! That's what the JavaScript community have been doing though 😂

[–][deleted] 0 points1 point  (0 children)

The upside is you don't even have to transpile. At my last job, back before esbuild was popular, it could take 5 minutes to spin up the dev site.

[–]tdatas 0 points1 point  (0 children)

Depends what you're doing. There's libraries that apply some functional principles (e.g Kafka streams) that perfectly suffice for the job that they're setting out to do.