Functional Programming with Java 8

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

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

  • @kennethsizer6217
    @kennethsizer6217 8 ปีที่แล้ว +39

    Caught Venkat at a conference a while back. Lively pace and lots of enthusiasm, but what bowled me over was his ability to field any question and nail it. IT was like the man wrote Java 8 and invented functional programming. By the end of Q&A, I was ready to yell "Freebird!" and hold up a lighter.

  • @happy_golden_retriever
    @happy_golden_retriever 4 ปีที่แล้ว +7

    I can't help listening to Venkat again and again - one of my very best Java-conference-speakers!

  • @jaykeunit
    @jaykeunit 8 ปีที่แล้ว +34

    Venkat is awesome. I'm lucky enough to have had him as a professor and take 4 of his classes.

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

    Never anyone explained the concept so passionately. I was really interesting to learn.

  • @aortizc82
    @aortizc82 10 ปีที่แล้ว +24

    Venkat is awesome, he's great explaining things.

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

    Everyone complaining about Break statement in for loop... We get it.... Just try to see the bigger picture painted by venkat instead of nitpicking an illustrative example... I think we will gain a lot more that way.

  • @pkronquist
    @pkronquist 6 ปีที่แล้ว +2

    Venkat is awesome.
    Minor correction: 9:30
    noneMatch() takes an IntPredicate when invoked on an IntStream. The predicate is 'isDivisible' (change it from Predicate to IntPredicate). Therefore, it should be:
    .noneMatch(isDivisible);

  •  10 ปีที่แล้ว +1

    As always, it's a pleasure hearing a talk of functional programming from Dr. Venkat Subramanian

    • @Javawithyogi
      @Javawithyogi 9 ปีที่แล้ว

      Pedro David Flores Cabañas

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

    Excellent presenter and great video on some of the new features of java 8 and how it can be used for functional programming.

  • @rightingletters1625
    @rightingletters1625 9 ปีที่แล้ว +45

    Terrible microphone. Please replace with a Snowball or a good Skype headset. It's a shame because your organization and enthusiasm are excellent.

    • @JetBrainsTV
      @JetBrainsTV  9 ปีที่แล้ว +23

      Ryan Joseph Thank you for your comment. We are on a never-ending quest for audio quality. Some of this is due to being a live webinar but we will continue to strive the highest quality recordings possible.

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

      +JetBrainsTV Agreed - really well done except the audio quality is painful.

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

    Amazing presentation skills. It's really fun listening

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

    Wow I never knew Java could do functional style programming. Thank you!

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

    this makes those of us coming from JavaScript-ES6 love Java even more

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

    What an amazing video. Venkat's enthusiasm is contagious :)

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

    Wow. This is functional programming for me! Great teacher Venkat... any other good videos to watch of Venkat Sir? I am a fan of his teaching now? Anyone else

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

    Awesome video lecture. I got insights in FP style. it's better than many safari video lectures. Thanks alot.

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

    It is very clear explanation of lamda! Thank you, Venkat!

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

    What a presentation! Kudos to Venkat Sir!

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

    This is good stuff!. After playing with Scala, I find the need of using FP in Java.

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

    I am impressed, you nailed it off subramaniam garu. Super.

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

    Really good explanation of functional programming. Thanks a lot.

  • @giovannicandidodasilva
    @giovannicandidodasilva 9 ปีที่แล้ว

    This is a very good starting point video about functional programming

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

    Great video, I did not notice how fast the video is finished.

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

    He is a java genius 🤩 It will be great if i met him once in a lifetime 🙂

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

    Venkat is such an interesting speaker.

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

    awesome video.. Totally a fan of your lectures.

  • @mr.RAND5584
    @mr.RAND5584 3 ปีที่แล้ว +1

    Real teacher.

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

    Also, the lazy evaluation can be done in a loop by using break once whats searched has been found.

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

    Venkat, you impress me!

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

    Great knowledge and very interesting

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

    Note: The second example will throw an error as the syntax used in the video is incorrect, the correct version of the isPrime method is shown below:
    private static boolean isPrime(int number) {
    Predicate isDivisible = divisor -> number % divisor == 0;
    return number > 1 &&
    IntStream.range(2, number)
    .noneMatch((IntPredicate) isDivisible);
    }
    N.B. This method requires " import java.util.function.*; " in order to work.
    Great talk otherwise, very helpful.

  • @amitbhatt5154
    @amitbhatt5154 8 ปีที่แล้ว

    Really very informative. Thanks Dr. Venkat

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

    At 20:02 I think the short circuit condition in your for loop would accomplish the same "laziness" you are getting in the lambda example. That is. Once it finds that one of the conditions is false it will stop executing further conditions in the if statement. Also breaking on a matching element means that it will stop running conditions after one is found that matches.

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

      Everyone is saying this. I think the point isn't that it is impossible to write good imperative code but that it is also so easy to write inefficient or buggy code, and that so many people do so. Also, something that I have heard on interviews from places that do all functional code is that "With the functional code we write, the business analysts can check the code themselves (tho they don't write it) -- they were not able to make heads or tails of our C++ code when we were doing that"...I'm getting more and more impressed by a lot of the stuff I am seeing with Streams -- they have put a LOT of work into it and by coming last to the party they did get to learn a lot from everyone else's experiences implementing things like this.

  • @Shailendrashail
    @Shailendrashail 8 ปีที่แล้ว

    Awesome explanation of functional programming

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

    This is really awesome information.

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

    Venkat Subramaniam is amazing. Does he has scala tutorials ?

  • @DmitriDonRU
    @DmitriDonRU 9 ปีที่แล้ว

    Very interesting, thank you Venkat! Higher video resolution would really help and please post more videos! :)

  • @sriramv4306
    @sriramv4306 9 ปีที่แล้ว +6

    Very nice presentation. Regarding, the example mentioned at 22:00 it was mentioned that iteration will happen till last value with traditional for loop which won't happen in the case of Java 8 lazy loading. I am wondering why not put a break statement after printing the first result thereby number of iterations will be the same as given here. Obviously with Java 8 lazy loading, the code is much simple, but I am not completely convinced by this example where number of iterations is mentioned as a difference. Can you please explain?

    • @johnnyshoes3708
      @johnnyshoes3708 7 ปีที่แล้ว +4

      you'e right, with imperative code, you'd still make it efficient. I guess, declarative programming is better, in that, it will default to optimum code, whereas, with imperative, you may write inefficient code.

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

      ^this
      i can have 1 for loop with 2 ifs where i first ask the first value > 3 and then %2 == 0 , if both are true i write result = value * 2 and break out of the loop
      this imperative code works the same as the functional, but you could have made the imperative code a lot worse
      this is the main problem for imperative programmers when they get introduced to functional programming, when you compare both people always show you bad imperative code and you might think: lol i am not that stupid
      the thing is: you arent but others are, and they will write shitty code till they are forced to write good code by using functional programming

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

    Wonderful explanation. Thank you so much!

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

    Hi,
    The captions for this video are really unclear. Is there anyway someone could edit them to reflect what is actually being said in the video?
    Thanks

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

    Awesome...well explained..

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

    at 9:00 the proper functional type to use IntPredicate instead of Predicate

    • @dayserivera
      @dayserivera 9 ปีที่แล้ว +2

      +Jose Ayerdis
      private static boolean isPrime(final int number) {
      IntPredicate isDivisible = divisor -> number % divisor == 0;
      return number > 1 && IntStream.range(2, number)
      .noneMatch(index -> isDivisible.test(index));
      }

  • @cahen153
    @cahen153 9 ปีที่แล้ว

    Excellent webinar, thank you!

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

    Very well explained.

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

    Very nicely explained

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

    This is Gold.

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

    Good beginner video but should've also touched on the java.util.function package in lieu of using static functions.

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

    22:33 WOW I'm impressed.

    • @amixpal
      @amixpal 9 ปีที่แล้ว

      +cafeta I didn't get it. What if the number were not sorted? What is the advantage here to not evaluating others? How it will give the correct output?

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

    That was greatly explained

  • @sixpooltube
    @sixpooltube 8 ปีที่แล้ว

    Awesome presentation!

  • @SreenathV
    @SreenathV 9 ปีที่แล้ว

    Excellent introduction

  • @nitishprabhu1222
    @nitishprabhu1222 8 ปีที่แล้ว

    Really, good teaching.
    Thank you...

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

    I finally understood lazy evaluation :) thank you

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

    Great video

  • @doug1727
    @doug1727 8 ปีที่แล้ว

    This video is awesome, thanks!

  • @anthonyruffino8979
    @anthonyruffino8979 9 ปีที่แล้ว

    Awesome explanations. It is too bad that the .apply method is needed. Otherwise this would be close to C#'s implementation of Predicates.

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

    Amazing, thank you.

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

    Amazing video but it requires some familiarity with java 8 constructs going in.

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

    9:58 .. isDivisible is an Predicate. You cannot give it an argument like isDivisible(index). So instead of writing nonMatch(index->isDivisible(index)) which is wrong you should write nonMatch(isDivisible)

  • @AvinashGA
    @AvinashGA 9 ปีที่แล้ว

    Excellent..... Thanks.

  • @lxndrlbr
    @lxndrlbr 7 ปีที่แล้ว +2

    The comment at 22:00 that imperative "for" loop does not break as soon as the functional "stream" operation is UNTRUE:
    public static void main(String[] args) {
    int[] values = new int[] {1, 2, 3, 5, 4, 6, 7, 9, 8, 10};
    int result = 0;
    for (int i = 0; i < values.length; i++) {
    if (isGreaterThan3(values[i]) && isEven(values[i])) {
    result = doubleIt(values[i]);
    break;
    }
    }
    if (result > 0) {
    System.out.println("result is " + result);
    } else {
    System.out.println("result not found");
    }
    }
    will output:
    isGreaterThan3 1
    isGreaterThan3 2
    isGreaterThan3 3
    isGreaterThan3 5
    isEven 5
    isGreaterThan3 4
    isEven 4
    doubleIt 4
    result is 4
    I understand the benefit of streams for parallelization, but in this case the presenter made a mistake, which cast doubt over all his presentation. I am very surprised and disappointed.

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

      I was trying to understand what you wanted to express through this comment. But it doesn't make any sense to me

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

      Look at my comment below th-cam.com/video/Ee5t_EGjv0A/w-d-xo.html&lc=Ugjl61ahNOi6j3gCoAEC.8FxDEmR-w3u8_ZDQYquBeG, that may show one of the benefits.. yes, presenter could have stressed a little more on such options to show the advantages more clearly

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

      I don't think presenter made a mistake... Are you saying this because of the added break statement? Well even in that case you had to manually think and add those 5 small but required letters and the code is still not declerative... This is an illustrative example where it is quite easy to manually optimize the statement with a break statement but don't you see how in a real world example this could become a problem while with functional coding it is done for you automagically. Look at the issue with a sum is greater than its part approach instead of letting our familiarity bias judge the speaker's authenticity my friend. Regardless of this example if we start judging everything spoken by anyone in light of one small incorrectness then that says a lot more about us than it says about the one being judged.... Don't be this disappointing. :D

  • @amixpal
    @amixpal 9 ปีที่แล้ว

    Wow! well presented :)

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

    I like how he mentioned "Transformation of objects rather than mutation of them". The only concern I have though is the amount of memory pressure of such an approach. Because with each transformation, the old object will be kept in memory until the garbage collector kicks in. The more GC kicks in, the more performance decrease will be seen since GC thread freezes the app until it is done as it deleted idle objects and move used but old ones. However, I see the benefit in concurrency when using less mutability.

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

    In parallel stream can we specify a thread executor ?

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

    I wish there would exist a single example of functional/lambda programming which does not use lists. Looks like entire construct is based on something that is not really used a lot in real life.

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

    I am not clear what Venkat mentioned at 20 mins that normal for loop will take 21 operations, but how ?? for example
    int findFirst=0;
    int isFound=false;
    for (int i = 0; i3 && myArray[i]%2==0)
    {
    findFirst=myArray[i]*2;
    isFound=true;
    break;
    }
    }
    if(isFound)
    {
    System.out.println("Desired number is -->"+findFirst);
    }else
    {
    System.out.println("Sorry no such number found");
    }
    Above code will take the same number of opertions as Declarative programming example which is I guess doing AND operation internally

    • @Ad-eq3cu
      @Ad-eq3cu 8 ปีที่แล้ว

      He means that there will be 21 operations if each "filter" and "map" operations in the stream creates its own loop, but his point is that it does not do that (I think because of lazy evaluation), so you get the declarative style and you have the efficiency of the code you wrote. Win-win.

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

      Your code doesn't even work due to a bug you introduced in an attempt to manage state. That's pretty funny when you think about it :)
      The point is to not manage state at all. What if you weren't savvy enough to know to use 'break'? Then you'd evaluate every input needlessly. You're now putting more effort into the implementation than working w/the answer.

    • @EdmondKachale
      @EdmondKachale 8 ปีที่แล้ว +4

      I think Abi has a point here. I don't see the "benefit" of lazy evaluation in the very example that Venkat mentioned. The traditional for loop will essentially do the same.

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

      The answer for your query is at 22:30, look how the variable is created which can be passed on to any method and execution happens lazily (which can't be achieved using older approach)
      public class Sample {
      private static boolean isGreaterThan3(int number) {
      System.out.println("isGreaterThan3 " + number);
      return number > 3;
      }
      private static boolean isEven(int number) {
      System.out.println("isEven " + number);
      return number % 2 == 0;
      }
      private static int doubleIt(int number) {
      System.out.println("doubleIt " + number);
      return number * 2;
      }
      public static void main(String[] args) {
      List values = Arrays.asList(1, 2, 3, 5, 4, 6, 7, 8, 9, 10);
      System.out.println("Start processing..");
      final Stream filtered = values.stream()
      .filter(Sample::isGreaterThan3)
      .filter(Sample::isEven)
      .map(Sample::doubleIt);
      // Here i'm sending the processed list into my remote method result handler.
      // See that, actual processing of stream happens when terminal operation is called
      // If result handler is not called, this will not execute, saving system resources
      // With earlier approach, we had to loop and find the result and keep it ready
      // for result handler code, even when it is not certain that the result will be used.
      handleResult(filtered);
      }
      private static void handleResult(final Stream filtered) {
      System.out.println("I'm a remote method, dedicated for only handling final result");
      System.out.println(filtered.findFirst());
      }
      }
      Result:
      Start processing..
      I'm a remote method, dedicated for only handling final result
      isGreaterThan3 1
      isGreaterThan3 2
      isGreaterThan3 3
      isGreaterThan3 5
      isEven 5
      isGreaterThan3 4
      isEven 4
      doubleIt 4
      Optional[8]

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

    Fantastic

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

    In this example the lambda one is around 50 times slower than the imperative one for finding isPrime.

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

      Hi abhinav... Please notice the point made at 47:20... Hopefully that makes things clear.

  • @Erin-bc8ic
    @Erin-bc8ic 9 ปีที่แล้ว

    Freaking awesome tutorial, you are the man! However, I was wondering if you or anyone reading this can help me out.
    I'm still learning Java and while I'm almost done learn the basic foundations of the Java language, I was wondering if I should keep learning more about Java in general/more advanced topics and then come back focus my attention on Lambda's or should I learn what I can about Lambda's before I proceed further.
    I'm only asking because the subject of Functional Programming can be very in depth, take up a lot of time and energy and I'm not sure which path is more optimal when it comes to learning Java, Lambdas and just programming in general. Thanks.

    • @GraverFILMS
      @GraverFILMS 8 ปีที่แล้ว

      +Eric M Skim over the topic and get a basic understanding so if you ever need it you'll look back and think "That would be perfect for this" and can get more in depth and learn it fully.

  • @creative-freedom
    @creative-freedom 9 ปีที่แล้ว

    one of the best !!!

  • @surajjagtap2892
    @surajjagtap2892 8 ปีที่แล้ว

    thanks and do more videos ..........

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

    6 operations
    for (I=1;I3)
    If(I%2==0)
    return I*2;
    //6 operations...not sure how the author says it is 21.
    Example around @19:00 min to @20:00

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

    superb!!!!!

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

    Good video

  • @ftank7903
    @ftank7903 8 ปีที่แล้ว

    More, please!

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

    No! it's not 21 operations with traditional loop. It cannot be simply because of break!.
    With the current list there will be:
    Operation #1 declaring the result variable outside the loop
    Operation #2 the number is 1 if !passed
    Operation #3 the number is 2 if !passed
    Operation #4 the number is 3 if !passed
    Operation #5 the number is 5 if !passed
    Operation #6 the number is 4 if passed
    Operation #7 the number 4 is doubled to 8
    Operation #8 breaking the loop
    So you have basically same number of operations.

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

    Did you just use LIGHT MODE!?

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

    Interesting concept, however I don't agree with quite a few points made such as readability. Yes, iterative code is often terrible, but that is because it is often written by terrible coders. Nothing would change if code is functional instead. Not only once have I read lambda expressions which are longer than my screen.
    I grant several points such as paralellism, but when written right oo code can be beautiful to read and write.
    Really, in terms of reading there is no difference between referencing a method or calling a method.
    Also: 11:43 use a for loop iterator
    At 20:00 I really don't know how you write your non-functional code but I certainly don't compute dead values.
    Lazy is a good argument, but god don't make me debug a programm that is lazy and lambda heavy...
    I am really not saying that this is all bad and I am all for removing ceremony, but it all should be used with caution.

    • @ImaginaryNumb3r
      @ImaginaryNumb3r 8 ปีที่แล้ว

      The points might be ridiculous, but so is commenting on somebody without having points on their own.

  • @DanielAlvarez-oj4mo
    @DanielAlvarez-oj4mo 10 ปีที่แล้ว

    excellent!

  • @giraserakesh
    @giraserakesh 9 ปีที่แล้ว

    Where can I find more of his videos on Java 8?

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

      +Rakesh Girase He is Dr. Venkat Subramaniam. He has many very nice videos such as Rewriting design patterns in Lambdas and streams, design and best practices, architectures..
      You can find them on youtube, vimeo and dailymotion.
      I recommend you to start looking in Devoxx 2015 youtube channel ;)
      Good luck !

  • @kisan-majdoorkalyansamiti7390
    @kisan-majdoorkalyansamiti7390 4 ปีที่แล้ว

    Do not use too many technologies other wise increase learning curve and manageability over period of time .

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

    HI venkat
    IntStream.range(1, 11).forEach(i->System.out.println(5+"x"+i+"="+(5*i)));
    i want to take range reverse order
    IntStream.range(11, 1).forEach(i->System.out.println(5+"x"+i+"="+(5*i)));
    how can we do it,please help me
    IntStream.range(start,end).boxed()
    .sorted(Collections.reverseOrder()).
    forEach(n->System.out.println("5"+"x"+n+"="+(5*n)));Thanks

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

    Can anyone please help me with the point he is trying to make at 13:42 I am a beginner in java
    I did not understand what was going on with the Optional [8].

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

      Yikes. I hope you either looked up Optional or watched one of a number of good videos about it. There are whole 1 hour videos just on Optional, which seems excessive but it is pretty important when working with Streams.

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

    Venkat #1

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

    Great

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

    "a tester tells ur code sucks.And i know it sucks how it sucks" hahaha at 12:08

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

      He uses that line all the time. And each time, the code sucks in a different way he teaches you to avoid...

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

    12:04 explains a whole life of programmer XD

  • @Mrinfiniteonce
    @Mrinfiniteonce 8 ปีที่แล้ว +11

    for (int i=2; i number % index ==);
    2nd version is 10 times more unreadable. And this is just replacing only a 'for loop' and a 'if' condition.

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

      +Infinite Once this is because Java is following C++14 style these days and getting complex and powerful.

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

      no, you are just familiar with the 1st version but it is not readable than the 2nd version. Second version clearly shows the intent of what should be done with a list.

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

      Familiarity vs simplicity.... There's a big difference my friend.

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

    COZORA BROUGHT ME HERE

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

    36:00

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

    23:00 epic

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

    Why is he looping up to number? That is double the amount than he would need -.-

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

    9:58, lol the code has a compiler error and he doesn't even fix it. Instead, he erases it.

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

      How can we fix this ?

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

      IntPredicate isDivisible = divisor -> number % divisor == 0;
      return number > 1 && IntStream.range(2 , number).noneMatch(isDivisible); - This will work

  • @TheGhostandTheFlame
    @TheGhostandTheFlame 10 ปีที่แล้ว

    I tried to watch this video, but the low quality (even in 720p) made it unbearable for me.

  • @MaxwellPietsch
    @MaxwellPietsch 7 ปีที่แล้ว +4

    Meh. The first example wasn't THAT compelling. Like, that's the best example you have? It's a little bit more expressive but not enough to convince me that Java functional programming is worth memorizing a bunch of new functions like .noneMatch(), etc. I do see how it is more easily parallelizeable, but not that the first example was more expressive.

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

      But yeah, maybe was for beginners

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

      Keep it Simple S.....

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

    I wish there would exist a single example of functional/lambda programming which does not use lists. Looks like entire construct is based on something that is not really used a lot in real life.

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

      Dude? Was that a joke? You work places that hardly use ArrayLists and other lists? I have been seeing a lot of examples from things other than Lists/Arrays, altho, as they note in other videos, because of the known size and subsizing they tend to parallelize the neatest and most profitably.