Java Streams to Complex Maps

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ก.พ. 2025

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

  • @flatmapper
    @flatmapper 3 หลายเดือนก่อน

    Quality content

    • @viraj_shetty
      @viraj_shetty  3 หลายเดือนก่อน

      Glad you enjoyed !

  • @anthonya880
    @anthonya880 5 หลายเดือนก่อน +2

    Please create a udemy course on Core Java (deep dive).

  • @ajs9721
    @ajs9721 5 หลายเดือนก่อน

    Yes, please. Do create some extra videos with examples. Better still add in one of your Udemy courses, or create a new one, please.

  • @Maximus98245
    @Maximus98245 5 หลายเดือนก่อน +1

    This just adds unnecessary complexity making the code unreadable and un-maintainable. Why not just write for loops and keep it simple? Streams do not provide any performance advantage over loops.

    • @viraj_shetty
      @viraj_shetty  5 หลายเดือนก่อน

      You have a point when it comes to complexity. In general functional style of programming is hard to get at first. It needs getting used to. Streams are very tightly coupled with Generics, Lambda expressions, Method References, Functional interfaces. It's not about performance (though you could argue in some cases you can use parallel streams). When you get used to functional programming, you will find it easier to create complex data structures - it will be less buggy.

    • @Maximus98245
      @Maximus98245 5 หลายเดือนก่อน

      @@viraj_shetty Thanks for the reply. I respectfully disagree, it's not about getting used to, it's about writing code that will be understood quickly and can be changed quickly by someone who has never seen the code before. I have seen non-trivial "functional" code that is a complete spaghetti of maps/collectors that spans over 50 lines and no one has a clue what's supposed to happen if we remove one of the "apply" calls :) I only care about performance, if I can save 10 micro-seconds by writing "for" loops, I will do it and "functional" style slows me down. Just my opinion, not that it matters :)

    • @viraj_shetty
      @viraj_shetty  5 หลายเดือนก่อน +1

      I guess we can write bad code given any tool. You will find functional coding styles now in every programming language.. It's yet another tool in the toolbox. Choose your poison wisely :)