Comment

Comment by Tainnor

I'll agree that Kotlin is not hardcore FP (although you can get there some of the way with Arrow etc.), but FP in Java is clunky.

- Having to remember the difference between "Function", "Consumer", "Predicate" and "Supplier" is weird. In Kotlin (and basically every other typed FP language that I know), I just write the type signature the natural way.

- Having to use streams in order to use map, etc., is noisy. Why weren't these APIs retrofitted to collections?

- Checked exceptions are a pain with functional code, e.g. map.

- Mutability is still the default behaviour of almost everything in Java, save records (and strings).

etc.

parent Tainnor 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton