Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I am really wondering why this is on HN front-page. It does not provide any good, in-depth analysis of FP in Java 8. In the contrary, the writing seems to be incoherent and assuming knowledge of a certain Java stack.


Same here this is a very bad blog. I don't see what you can learn from this tutorial. If you want to learn Java I wrote a series https://github.com/shekhargulati/java8-the-missing-tutorial covering new features of Java 8.


Last month I created a badly-written blog post (it started out as an incoherent email written at my day job which I later fleshed out into an incoherent blog post) discussing Java 8's Optional type: https://jamesadam.me/index.php/2016/08/04/thoughts-on-java-8...

In particular, I both love and hate the new streams API. It's nice to work with but easily leads to code that is hard to read and hard to debug.

No, I wouldn't call Java 8 a functional language either. Its 'functional' features are more of a tease than anything else, as you'll quickly discover their limitations (and they definitely feel tacked-on rather than an integral part of the language).


Agreed. A major red flag is the omission of generics usage on their methods. Just using List or Collection without type parameters is just dangerous and very bad advice for a novice programmer seeking enlightenment for Java 8 programming.


It looks like the generics used to be there but have been removed. Because there is one generic type 'T' left in the implementation of ClassUtils.setIfNotNull.

So about this setIfNotNull: I don't understand why this method is used in updateEntity. To me it seems the accountType property in the dto can be set with whatever is in the entity, null or not null. And of course, Java 8 has introduced the Optional class as a better way of dealing with null values, so why bother writing a workaround at all?


I see now, probably just something to do with formatting/escaping, the <> are being swallowed.

Yes, it's strange. I'd prefer to map a null in a DTO to an empty optional. I'd like even more to never have nulls in the dto in the first place.


I assumed the omission was for brevity, but there are annotations and 'final' in a lot of places.

Similarly, methods for mutation (compulsory, no less!) are red flag in FP.


As someone who isn’t familiar with functional programming at all or too familiar with Java, where do I start?


Unless you have a strong reason to use Java, I'd stay far out of it in learning FP. Pick a language where FP model fits well into the language core (e.g., ocaml, Haskell; google for other options), not glommed on as an afterthought to a general purpose language.


Depends on your goals, Java isn't the best if your aim is to learn FP.





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

Search: