Common mistakes made in Functional Java by Brian Vermeer

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 ต.ค. 2024

ความคิดเห็น • 20

  • @shriramparamesh
    @shriramparamesh 4 ปีที่แล้ว +14

    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

  • @johnsand3290
    @johnsand3290 5 ปีที่แล้ว +8

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

  • @gautamawekar1
    @gautamawekar1 5 ปีที่แล้ว +4

    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.

    • @berndeckenfels
      @berndeckenfels 4 ปีที่แล้ว +2

      It does kind of with reactive streams, now. They have an error channel.

  • @MikeEnRegalia
    @MikeEnRegalia 2 ปีที่แล้ว +1

    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.

    • @m19u3l11
      @m19u3l11 7 หลายเดือนก่อน

      In any case, Stream is NOT a collection so if's going to be used in that way expected unexpected results.

  • @vijayjayaram606
    @vijayjayaram606 3 ปีที่แล้ว +3

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

  • @nitinagrawal6637
    @nitinagrawal6637 4 ปีที่แล้ว +2

    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.

  • @noname78520
    @noname78520 ปีที่แล้ว

    awesome talk!

  • @nitinagrawal6637
    @nitinagrawal6637 4 ปีที่แล้ว +1

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

  • @romantsyupryk3009
    @romantsyupryk3009 4 ปีที่แล้ว +2

    Thanks so much for this talk.

  • @tungtranvan1286
    @tungtranvan1286 3 ปีที่แล้ว

    I saw myself in your example. Thank you :D

  • @kokavamsikrishna3933
    @kokavamsikrishna3933 5 ปีที่แล้ว +1

    Greate , Awesome thanks for making this video,

  • @jfilipcic
    @jfilipcic ปีที่แล้ว

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

    • @mihaiapostol7864
      @mihaiapostol7864 ปีที่แล้ว

      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

  • @temnur
    @temnur 5 ปีที่แล้ว

    Good for beginners

  • @pnadmin7927
    @pnadmin7927 5 ปีที่แล้ว

    So Venkat always say we should use Reactive stream. LOL

  • @ebn__
    @ebn__ 5 ปีที่แล้ว +2

    Using Java for FP is the common mistake.

    • @alekseyreviakin3019
      @alekseyreviakin3019 5 ปีที่แล้ว

      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?

  • @AngelCintiaRockgirl
    @AngelCintiaRockgirl 5 ปีที่แล้ว

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