Streams in Java 8: Reduce vs. Collect

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ธ.ค. 2024
  • Since Java 8 the JDK has a Stream API. Among numerous other operations the Stream API offers two operations - reduce() and collect() - which are occasionally misunderstood and thus used incorrectly - at the expense of introducing subtle bugs in conjunction with parallel strams. In this tutorial we will discuss the background of this common misconception: reduce () is an operation that stems from functional programming languages, where objects are typically immutable. Java, in contrast, is an object oriented language, where most objects are mutable. Hence, Java needs something like a "mutable reduction". This is what the stream operation collect() offers. As both operations - reduce() and collect() - are very similar, they are occasionally mixed up - which can lead to concurrency issues when executed on parallelstream. The tutorial will explain why.
    jDays 2016

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

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

    She explained reduce and collect concepts brilliantly.

  • @nishikanttayade7446
    @nishikanttayade7446 4 ปีที่แล้ว

    I just don't have words, so many points juat clicked about streams..GREAT!! Thanks

  • @tmustafad
    @tmustafad 6 ปีที่แล้ว +1

    Maybe the best explanations of Stream API which I have seen so far !

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

    You are very good speaker and this is the best explanation of reduce / collect I've ever seen! Great conference

  • @dinkocejvanovic2296
    @dinkocejvanovic2296 2 ปีที่แล้ว

    Best explanation ever, thanks a lot to Angelika!

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

    That's awesome. Although I have been using collect for years, I don't know the real difference between the two methods. Her speech is clear, decent and full of passion.

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

    This is a really really good tutorial on java8 streams .
    Om Pandey

  • @gregerolsson1713
    @gregerolsson1713 7 ปีที่แล้ว +6

    Very good talk, fantastic speaker.

  • @navnathjadhav9111
    @navnathjadhav9111 4 ปีที่แล้ว

    😱 what a deep study.. Ever first time found such a deep and good explanation..

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

    Fantastic presentation!! She is a great speaker

  • @20manojpandey
    @20manojpandey 8 ปีที่แล้ว +2

    Thanks for sharing, this really explains insight of reduce and collect

  • @stephanenicolas745
    @stephanenicolas745 7 ปีที่แล้ว

    I agree, amazingly clear and technically skilled speaker. Thx !

  • @Женя-р8ц3й
    @Женя-р8ц3й 3 ปีที่แล้ว

    She is awesome lector!

  • @SpiritOfIndiaaa
    @SpiritOfIndiaaa 4 ปีที่แล้ว

    Thanks a lot , really good...tutor experience reflecting the way she simplified the topic...she nailed it.

  • @alainkr
    @alainkr 4 ปีที่แล้ว

    Great talk, super clear

  • @sherbeka.9819
    @sherbeka.9819 6 ปีที่แล้ว +1

    So many things started making a sense. Yeah, let me get a coffee too.

  • @xalfonso85
    @xalfonso85 7 ปีที่แล้ว

    great conference!!!

  • @thecosmicantinatalist
    @thecosmicantinatalist 6 ปีที่แล้ว

    Are there more talks by this speaker?

  • @VIRAJBHOSLE
    @VIRAJBHOSLE 6 ปีที่แล้ว

    Awesome! Thanks a lot!

  • @timwalters5355
    @timwalters5355 4 ปีที่แล้ว

    A concatenation of strings should not return a StringBuilder, this can avoided by using a finisher in a collector, but reduce doesn't have this option..

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

    i am proud about object oriented programming... fuck those functional languages.... these languages are not able to survive in the industry... Java is still relevant after 20 years of its development.... it speaks volumes... should be named as most influential programming language

  • @LoiNguyen-tl1sy
    @LoiNguyen-tl1sy 6 ปีที่แล้ว

    Thanks for the talk