The Power and Practicality of Immutability by Venkat Subramaniam

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ต.ค. 2024
  • Functional Programming promotes assignment-less programming. When we remove mutability, we reduce errors in code. How practical is it to really program with immutability in Java and if we manage to achieve that, what are the real benefits. Come to this talk to learn about the power, the benefits that immutability brings and how to practically make use of that in Java.
    Dr. Venkat Subramaniam is an award-winning author, founder of Agile Developer, Inc., creator of agilelearner.com, and an instructional professor at the University of Houston. He has trained and mentored thousands of software developers in the US, Canada, Europe, and Asia, and is a regularly-invited speaker at several international conferences. Venkat helps his clients effectively apply and succeed with sustainable agile practices on their software projects.
    Venkat is a (co)author of multiple technical books, including the 2007 Jolt Productivity award winning book Practices of an Agile Developer. You can find a list of his books at agiledeveloper.com. You can reach him by email at venkats@agiledeveloper.com or on twitter at @venkat_s.

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

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

    Very good question and answer at 50:23

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

    Congratz Mr Venkat, your talks are always a sea a knowledge :)

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

    he goofs up the example performance of imperative vs declarative.

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

      What do u mean? Could u mention the time and what was goofed up?

    • @reallylordofnothing
      @reallylordofnothing 8 หลายเดือนก่อน

      @@crabsynth3480 he wanted to show that stream calls a collection of functions on each piece of data as opposed to imperative which calls functions on collection of data but both yellow stickers are the same, so not sure what he was trying to say there.

  • @eldiosdelcielo
    @eldiosdelcielo 10 หลายเดือนก่อน

    needless to say u rock

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

    Man, that was awesome....

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

    39:50 Awesome had to try it in dart and with Rx observables :p

    • @reallylordofnothing
      @reallylordofnothing 8 หลายเดือนก่อน

      Could you explain what is the difference between the two yellow sticky notes? they both are the same, so how did he explain the distinction between functions on all your data and collection of functions on each piece of data?

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

    great.

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

    Why to unfriend from FB if any body using goto 😂😂

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

    Great lecture thank you

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

    Great talk, thanks a lot for the speaker.

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

    As mentioned in 20:52 , Can you please explain how are you achieving thread safety using stream?

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

      concurrentCollections would be used internally when relying on collectors with parallel streams.

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

      I think point is stream uses lamba and lamba mandate variable to be effectively final.

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

    In the immutable example of factor shown here. Is it good practise to assign the factor to another local variable so that function remains pure as long as code doesn't have any other dependencies on that local variable ?

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

    For summing even numbers, why is he multiplying each even number by 2?

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

    @46:00 -- "Impure code"
    line #13 "factor[0] = 0;" would be executed only after the stream methods pipeline on lines 10-11 ends. If so, how is the value of 0 going into the body of Function.apply() for factor[0] but not 2?
    I understand why this is called impure code, but in this particular context -- this is confusing!
    Anyone understood the inner meaning?

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

      Streams do not start running the pipeline until there's something collecting from them. In the example, venkat gave, the stream started collection on line 15 because forEach is a terminal operation.

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

      @@pritishnayak Yes. Thanks for writing
      I realized this that day itself. Forgot to remove my msg :)
      Initially I didn't notice that stream object was assigned on line 10.

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

    What is that editor with the live-evaluation of java?

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

      This gets posted on every one of his talks. According to other commenters, it's TextMate, a Mac OS X exclusive editor.

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

    There seems to be something wrong with the increment method at 12:50. Anybody with me?

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

      what do you mean? It's simply incrementing the passed value by 1 and passing the incremented value to next call stack.

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

    How can you make your Object immutable when you pass it along in your java 8 stream pipeline? Would it be ok to mutate object within the stream pipeline functions since only one thread will execute the whole pipeline?

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

      I think usually you will create a new refence with the mutation applied to it, but I am a beginner to functional programming, so I am not sure.

  • @赵云-z7z
    @赵云-z7z 5 ปีที่แล้ว +1

    Why did he take off his shoes?

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

    25:11 totally relatable. Hahhaa

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

    Great insights. Two suggestions 1. Take a little complex examples. Everything he talks is about arrays and for loops. 2 he needs to be more crisp in his talks and videos can be half length. He repeats things too many times.

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

    all good but the way he's pronouncing immutability, is something I can't handle

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

    Dude is certainly in a hurry