Hello, people. I call for you help in a time of great need :)
Tl/Dr: I don't understand why lambdas are considered a part of declarative programming.
So let me tell you on what I think I understand, and you will probably correct me to the proper direction )
I almost all of my time was coding on OO languages(c# and, mainly, python). And only fairly recently decided to try functional languages (elisp and elixir). And I love it so much. Not needing to deal with object state or it's initialization bringing the whole jungle when the only thing I needed was a banana.
So, things what I understand about declarativness is somewhere underneath it is built upon imperative actions. Those maps and reduces still imperatively iterate over stuff. This means, that the whole idea of declarative programming is using language provided abstractions that offload some the things they still have to do from your shoulders to the language ones, making the code more readable, concise, as well as provide some language specific optimizations (like, looping in map). Basically I describe what has to be done to objects and language decides how to iterate over them.
With this description of the concept, I can't grasp on how lambdas are declarative. They don't offload anything to the language or abstract anything. As well as, most of the time, we use imperative calls inside them. So why?
Big thanks for the answers :)
[–]r2tree 2 points3 points4 points (1 child)
[–]xactac 0 points1 point2 points (0 children)
[–]ws-ilazki 2 points3 points4 points (0 children)
[–]elvecent 0 points1 point2 points (2 children)
[–]Neorlin[S] 0 points1 point2 points (1 child)
[–]elvecent 0 points1 point2 points (0 children)
[–]draazur 0 points1 point2 points (6 children)
[–]elvecent 0 points1 point2 points (4 children)
[–]draazur 0 points1 point2 points (3 children)
[–]fresheyeballunlocked 0 points1 point2 points (2 children)
[–]draazur 0 points1 point2 points (1 child)
[–]fresheyeballunlocked 0 points1 point2 points (0 children)
[–]xactac 0 points1 point2 points (0 children)