This video is about calculating the total sum of numbers.
It is inspired by the examples provided in the video “Object Oriented Programming vs Functional Programming” of the channel @ContinuousDelivery.
• Object Oriented Programming vs Functional ...
In this video I explain why the comparison of the fold with imperative solution, for doing a sum of numbers is unfair. The imparative solution is much less powerful and not generic.
I will step by step generify an imperative Java solution, first by using Object Orientation, then moving towards Functional Programming, in order to level the playing field.
The fold solution should emerge as one of the simplest, most readable and elegant solutions possible for that problem.
Finally, we quickly generify the recursive Haskell solution as well.
This is just a remark to a small portion of an excellent video. I am just bringing another point of view to the conversation.
Please enjoy the journey!
PS: This video uses some pictures generated by Dalle-2 (watermark maintained, with exception of the thumbnail that has been cropped)
For any other pictures, the source is in the video.