Common mistakes made in Functional Java by Brian Vermeer

preview_player
Показать описание

In Java 8 functional style programming was introduced in Java. Java 9 extended this with some nice new features. For many people it is hard to grasp the idea of functional style programming after so many years of purely working in the imperative OOP style. The opportunities Java gives us out of the box are massive on the other hand with great power comes great responsibility. Let me point out common mistakes that are made when integrating functional style programming in your every day Java project and how to prevent this. This way you can make better, cleaner and more readable code. But even more important, you will be able to utilize the functional code constructions in Java 9 to it's full potential!.. and maybe, you even start to like it.


Brian Vermeer
From Blue4IT
Software Engineer for Blue4IT working consultancy based on mainly Java projects for the Top-100 companies in the Netherlands. Passionate about Java, (Pure) Functional Programming and Cybersecurity. Co-writer on the published Research paper: Plagiarism Detection for Haskell with Holmes. Besides being an engineer he is a Reservist at the Royal Netherlands Air Force and a Taekwondo Master.
Рекомендации по теме
Комментарии
Автор

4:07 - Doing too much in a single lambda.
7:19 - Returning a stream in a method. Reusing a stream.
11:09 - Forgetting to consume a stream
14:40 - Mutate objects inside a stream.
20:24 - Overusing forEach
24:08 - Order of operations
30:31 - 'Get'ting an Optional.
37:29 - Checked Exceptions and Lambda

shriramparamesh
Автор

nice talk, I liked the part about exception handling. Could you upload the sourcecode of your Either implementation?

johnsand
Автор

A good presentation giving a set of suggestions to do sensible coding.

nitinagrawal
Автор

Nice talk..to the point. Liked the Optionals & Stream exception handling. I wonder why can't java inherently support some utils to support these limitations.

gautamawekar
Автор

I saw myself in your example. Thank you :D

tungtranvan
Автор

I take issue with #2. In a use case where most clients calling a method that returns a collection will create a stream from it, it is more efficient to just return a stream directly. Callers who need to iterate twice can call the method twice. Callers who need a data structure can convert the stream easily, using concise code.

MikeEnRegalia
Автор

Asking a question should not change the answer, nor should asking it twice - I think it depends on the context of the question, depends on the type of question. So before applying any such concept one must understand it first.

nitinagrawal
Автор

Greate, Awesome thanks for making this video,

kokavamsikrishna
Автор

There is a reason why he referred to Venkat 🙏🏼 at the beginning
Venkat owns java streams and lambda
🤘

vijayjayaram
Автор

I don't understand why the 0, 1... iterator gets stuck when run in parrallel. Could please anybody explain it like I'm five?

jfilipcic
Автор

So Venkat always say we should use Reactive stream. LOL

pnadmin
Автор

Using Java for FP is the common mistake.

ebn__
Автор

lyhahahahha, pretending that Java is actually a real compiler. hahhaahaha

AngelCintiaRockgirl