for the record, the course he mentions is free and it's name is "JDK 8 Massive Open and Online Course: Lambdas and Streams Introduction" and it a very good introduction to these topics
At 18:32 from the original sequential Java 7 solution, we see that it will always return the FIRST line of the longest length, in the case of ties (reasonably likely if there are a very large number of lines)...the reduction at 23:20 will always give us the LAST line of the max length in the case of ties, right? Subtle difference, but a drop-in replacement would break a good enough Unit Test? I had to write code to check because Simon is brilliant and I am dense, but yeah, we needed >= if coded as shown at 23:20 to preserve behavior in the face of ties.
Not everyone gets the point of his very funny story. There were real improvements in "getting more functional" until 14:08 or thereabouts, when he said "I am good". That is, there were benefits along the way, until at some point, well along the evolution towards "being more functional" you are solely pursuing ideological Purity.
Excellent talk by Simon as usual...one thing I didnt get is the recursion example solving the problem of removing state,,,which state is being considered in these code example...Can someone please assist..Thanks
Functions by definition do not have state, objects do. When I give you a function and say this function returns true if your input integer is greater than 0 you will get true every single time you call that function with a positive integer. When I say this function will return true if your input is bigger than the previous input you gave it then the result will depend on the previous call you made to the function. I will give it 5 then 10 and I will get true. You will give it 15 and then 10 and despite giving the same input 10 you will get false. This is state. When you called the function it was in a state that would return false to input 10 BUT when I called it at the time it was in a state that would return true to input 10. Once he modified the function as a recursive one he eliminated the state. Rather, he moved the state to the application level out of the function itself.
I think he said an IO Monad, although I'm not entirely sure. If he did say that, some reference on what it is: en.wikipedia.org/wiki/Monad_(functional_programming)#The_I.2FO_monad
@@nicholas1460 Actually both are true. It's originally Observer Effect, applied to systems in general. But Heisenberg used the same in quantum mechanics (sub atomic level) to explain why we can't accurately measure momentum and position of the electrons simultaneously. But later it was proved that in quantum mechanics Observer Effect doesn't apply bcz the sub atomic particles inherently exhibit dual (energy as well matter) property by their very nature. And that's called "Uncertainty Principle" (not Heisenberg's).
Good speaker. Attentive to the auditory. And he shares his own experience and you can see the passion when he does it.
one of the best videos on lambda
That's brilliant. Your explanation helped me out after days being really confused about functional programming!
for the record, the course he mentions is free and it's name is "JDK 8 Massive Open and Online Course: Lambdas and Streams Introduction" and it a very good introduction to these topics
where to find that course
@@darogajee3286 Dude, do a simpe google search
@@onke ohh really its that simple please provide me link ...
great talk, packed in an interesting story - thanks, Simon!
Awesome presentation!👍
5 mins in, beautiful!
At 18:32 from the original sequential Java 7 solution, we see that it will always return the FIRST line of the longest length, in the case of ties (reasonably likely if there are a very large number of lines)...the reduction at 23:20 will always give us the LAST line of the max length in the case of ties, right? Subtle difference, but a drop-in replacement would break a good enough Unit Test? I had to write code to check because Simon is brilliant and I am dense, but yeah, we needed >= if coded as shown at 23:20 to preserve behavior in the face of ties.
The point would be driven home better if you show the implementation of finest and show the lazy evaluation that takes place.
Not everyone gets the point of his very funny story. There were real improvements in "getting more functional" until 14:08 or thereabouts, when he said "I am good". That is, there were benefits along the way, until at some point, well along the evolution towards "being more functional" you are solely pursuing ideological Purity.
Which is the best book to master Functional Programming in Java 8
Beginner
Intermediate
Expert
Went looking for Heisenberg's uncertainty principle after the first slide. Now I am more confused than ever.
You shouldn't have looked for it.
Excellent talk by Simon as usual...one thing I didnt get is the recursion example solving the problem of removing state,,,which state is being considered in these code example...Can someone please assist..Thanks
Functions by definition do not have state, objects do. When I give you a function and say this function returns true if your input integer is greater than 0 you will get true every single time you call that function with a positive integer. When I say this function will return true if your input is bigger than the previous input you gave it then the result will depend on the previous call you made to the function. I will give it 5 then 10 and I will get true. You will give it 15 and then 10 and despite giving the same input 10 you will get false. This is state. When you called the function it was in a state that would return false to input 10 BUT when I called it at the time it was in a state that would return true to input 10.
Once he modified the function as a recursive one he eliminated the state. Rather, he moved the state to the application level out of the function itself.
Excellent talk
18:33 is the highlight. nice.
thanks a lot
For the functional think ... I don't understand what he says ... "You need an XXX"?
I think he said an IO Monad, although I'm not entirely sure. If he did say that, some reference on what it is: en.wikipedia.org/wiki/Monad_(functional_programming)#The_I.2FO_monad
he did
i need to catch up with it later. now it's late at night and i need to go to bed
+Simon, slf4j, log4j don't expose methods with Supplier as method argument. What do you think is the best way to use slf4j and Supplier? thanks.
SkalarZiom I'd personally look to create a wrapper.
That's not what Heisenberg's uncertainly principle says at all!
Right. Which principle was it then? Observer effect?
@@nicholas1460 Actually both are true. It's originally Observer Effect, applied to systems in general.
But Heisenberg used the same in quantum mechanics (sub atomic level) to explain why we can't accurately measure momentum and position of the electrons simultaneously.
But later it was proved that in quantum mechanics Observer Effect doesn't apply bcz the sub atomic particles inherently exhibit dual (energy as well matter) property by their very nature. And that's called "Uncertainty Principle" (not Heisenberg's).
Your recursive method used tail-call recursion, so wasn’t it already stack-safe?
Java 8 does not support tail call optimization at compiler level
String LongestLine = bufferedReader.lines()
.max(Comparator.comparing(String::length))
.orElse("");
Another streams and functional programming zealot. You can skip this one.
Not a fan? Shame.