Very good, in depth explanation. Thank you. I wrote similar algorithm for solving countdown numbers game long time ago, when I was still at university. It was challenging, but fun problem to solve. I spent couple of weeks on it, on and off, and in the end I come up with quite elegant general solution, although I don’t know if it was as efficient as the solution described in your video.
Great video as always José, with some truly insightful content! However, I personally miss the old format where you would code live and explain your thought process as you go. It helped me understand not just the 'what,' but also the 'why' behind each line of code. Looking forward to more great content!
We should have another one where Java's support of Functional / Data-oriented programming paradigms is investigated. It can also detail which Java libraries are built on which paradigm, etc
28:23 I don't think you really need that initializer block, you might as well just assign the value in the field declaration directly, e.g. `Element previous = toBeInserted;`
@@JosePaumard I don't understand what you mean. You're capturing the variable `toBeInserted` exactly the same way whether you use it in an initializer block or a declaration with assignment because it's all within the scope of the local/anonymous class. In both cases, `toBeInserted` needs to be effectively final for this pattern to function. The only way to avoid capture would be to assign the field after the object has been constructed, i.e: var state = new Object(){Element previous;}; state.previous = toBeInserted; Please correct me if I'm wrong though.
@@jay_sensz Yes you're right, my bad. In an earlier (unpubslihed) version, there was more code in this init block, reason why it's still there. But it's not needed anymore now.
It was very interesting video,I didn't jet arrive to this point in Java Programming,I am just a beginner with passed First Introduction To Java Programming Certificate,but,anyway it will be to me useful one day I hope!!!Cheers 🙂
When You made a bunch of similar videos notify me or I will see it on RUclips Channel to enjoy in Your entertainment of Lectures once again!!!See Ya Abroad as soon as possible
One of the methods is `boolean equals(Object o)`, and `Object`defines an implementation for that method. Thus, you can target `Comparator` with a lambda/method reference that defines the other method, `int compare(T o1, T o2)` And from the JLS: 9.8. Functional Interfaces A functional interface is an interface that has just one abstract method *(aside from the methods of `Object`)* [my emphasis]
Why does everything need to be a gimmick? What is wrong with just presenting the code and functionality? Adult programmers don't need gimmicks like coffee intro and backstory. Just get to the point please.
@@edmaphis9805 it’s funny that a lot of OOP programmers recently when their languages started to get FP features began to introduce new terms such as “pipe oriented programming”, “data oriented programming” etc. and it’s just weird
Why compareElement(e1,e2) method has to rely on the premise e2 >= e1 in their implementation Integer.compareTo(e2,e1) ? Integer.compareTo(e1,e2) doesn't works
Finally, Java is flexing on its multi-paradigm design
It actually started 18 years ago when Java started to embrace elements of Functional Programming.
yup... making an enormous unmitigated mess of paradigms.
ruclips.net/p/PLzzeuFUy_Cng0wZhqbnkvWAW0d2fdVfyQ&si=VnMrzYqgs7-fKmeW a combo functional java + french language. 2 for the price of one for free.
Very good, in depth explanation. Thank you.
I wrote similar algorithm for solving countdown numbers game long time ago, when I was still at university. It was challenging, but fun problem to solve. I spent couple of weeks on it, on and off, and in the end I come up with quite elegant general solution, although I don’t know if it was as efficient as the solution described in your video.
It's indeed a funny problem to work on 🙂
Great video as always José, with some truly insightful content! However, I personally miss the old format where you would code live and explain your thought process as you go.
It helped me understand not just the 'what,' but also the 'why' behind each line of code.
Looking forward to more great content!
Hi, guys! Why there are no more any new videos of Java Cafe? I'm so waiting for them :)
That's one long coffee break...
The boss is getting wise too.
Is the DIV case at 21:24 supposed to have `resolve(left) % resolve(right)` instead of `resolve(right) % resolve(right)`?
Indeed. Thanks for reporting this! The code in the Gist is correct.
Also @ 22:40 all four operations are treated like Add
@@lolo101 Oooops...
Papermc discord?
Great ideas but complex code in general :)
Well the algorithm is more complex than the code imho.
We should have another one where Java's support of Functional / Data-oriented programming paradigms is investigated. It can also detail which Java libraries are built on which paradigm, etc
Good idea! Do you have a specific library in mind?
@@JosePaumard Unfortunately no. I never taught about it before even recommending :
@@Ambusher306 😄Let me think about it then.
Where can I get that Java coffee cup? I can’t seem to find it anywhere!?
just print one dude! it's not that hard nor expensive.
Love from india you doing superb job
Thank you, I appreciate it!
Thanks a lot. ❤
You welcome Khaled!
28:23 I don't think you really need that initializer block, you might as well just assign the value in the field declaration directly, e.g. `Element previous = toBeInserted;`
Yes, but it changes everytime it is called in the stream. In that way you don't use capturing variable.
@@JosePaumard I don't understand what you mean. You're capturing the variable `toBeInserted` exactly the same way whether you use it in an initializer block or a declaration with assignment because it's all within the scope of the local/anonymous class. In both cases, `toBeInserted` needs to be effectively final for this pattern to function. The only way to avoid capture would be to assign the field after the object has been constructed, i.e:
var state = new Object(){Element previous;};
state.previous = toBeInserted;
Please correct me if I'm wrong though.
@@jay_sensz Yes you're right, my bad. In an earlier (unpubslihed) version, there was more code in this init block, reason why it's still there. But it's not needed anymore now.
Where can we get that Java coffee mug ❤😊
I couldn't wait!!!🙂🙃🙂
It was very interesting video,I didn't jet arrive to this point in Java Programming,I am just a beginner with passed First Introduction To Java Programming Certificate,but,anyway it will be to me useful one day I hope!!!Cheers 🙂
By The Way IT is so wide and excitful I couldn't even imagine!
@@milosristic1111 Thank you, glad you liked it!
When You made a bunch of similar videos notify me or I will see it on RUclips Channel to enjoy in Your entertainment of Lectures once again!!!See Ya Abroad as soon as possible
Dynamic programming left the chat.
when @Functional interface contains only one abstract method then why comparator interface contains two abstract methods
One of the methods is `boolean equals(Object o)`, and `Object`defines an implementation for that method. Thus, you can target `Comparator` with a lambda/method reference that defines the other method, `int compare(T o1, T o2)`
And from the JLS:
9.8. Functional Interfaces
A functional interface is an interface that has just one abstract method *(aside from the methods of `Object`)* [my emphasis]
Aaawesome 😊
Awsome
I, m new again java
Why does everything need to be a gimmick? What is wrong with just presenting the code and functionality? Adult programmers don't need gimmicks like coffee intro and backstory. Just get to the point please.
Bro u have a cartoon profile pic and are throwing a tantrum in a RUclips video.
😂 “Data” oriented programming. It’s just functional programming that is old as shit
I think they use that term to contrast it with Object Oriented programming.
@@edmaphis9805 it’s funny that a lot of OOP programmers recently when their languages started to get FP features began to introduce new terms such as “pipe oriented programming”, “data oriented programming” etc. and it’s just weird
@@ChannelCheesecake It's actually a thing. Phil Wadler wrote and talked about it.
Back to COBOL I go 😏
@@KangoV Back to the roots! 😆
Why compareElement(e1,e2) method has to rely on the premise e2 >= e1 in their implementation Integer.compareTo(e2,e1) ? Integer.compareTo(e1,e2) doesn't works