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
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.
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.
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.
i think because the results of the threads are joined right before the terminal operation, but we never get to the terminal operation because of the distinct(). try using a peek() after each stream operation to see what's happening. it confused me as well
I watched this video and video about near Java future: th-cam.com/video/hryQIIasGY4/w-d-xo.html and thought: "Look Java is almost like Scala now". Maybe Java need own way?
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
nice talk, I liked the part about exception handling. Could you upload the sourcecode of your Either implementation?
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.
It does kind of with reactive streams, now. They have an error channel.
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.
In any case, Stream is NOT a collection so if's going to be used in that way expected unexpected results.
There is a reason why he referred to Venkat 🙏🏼 at the beginning
Venkat owns java streams and lambda
🤘
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.
awesome talk!
A good presentation giving a set of suggestions to do sensible coding.
Thanks so much for this talk.
I saw myself in your example. Thank you :D
Greate , Awesome thanks for making this video,
I don't understand why the 0,1... iterator gets stuck when run in parrallel. Could please anybody explain it like I'm five?
i think because the results of the threads are joined right before the terminal operation, but we never get to the terminal operation because of the distinct(). try using a peek() after each stream operation to see what's happening.
it confused me as well
Good for beginners
So Venkat always say we should use Reactive stream. LOL
Using Java for FP is the common mistake.
I watched this video and video about near Java future: th-cam.com/video/hryQIIasGY4/w-d-xo.html and thought: "Look Java is almost like Scala now". Maybe Java need own way?
lyhahahahha, pretending that Java is actually a real compiler. hahhaahaha