3 ms·
> I don't want functional-flavoured programming, I want functional programming. > you gotta stop using those for-loops and [i]ndexes, and start using maps, fol
by troupo 2y ago
> I don't want functional-flavoured programming, I want functional programming.
> you gotta stop using those for-loops and [i]ndexes, and start using maps, folds, filters etc.
You mean what C# literally does everywhere because Enumerable is the premier weapon of choice in the language, and has a huge amount of exactly what you want: https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable https://learn.microsoft.com/en-us/dotnet/api/system.linq.enu...
(well, with the only exception of foreach which is for some odd reason is still a loop).
> But 5 years after that
Since .net 3.5 18 years ago: https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable?view=netframework-3.5 https://learn.microsoft.com/en-us/dotnet/api/system.linq.enu...
> So we paid the price, but didn't get the reward.
Who is "we", what was the price, and what was the imagined reward?
- mrkeen 2y ago> Who is "we", what was the price, and what was the imagined reward? Slow down and re-read. >> You get: the knowledge that your function's output will only depend on its input. >> You pay: you gotta stop using those for-loops and [i]ndexes, and start using maps, folds, filters etc.
- troupo 2y agoStill makes no sense. Once again: who paid, what was the price, what was the expected reward?
- tmtvl 2y agoWho paid: programmers switching to FP. What was the price: two things: - The programmers must stop using for-loops and [i]ndexes. - The programmers must start using maps/folds/filters/et cetera. What was the expected reward: the knowledge that their functions' outputs will only depend on their inputs. In short: programmers who change their behaviour get the benefit of certainty about specific properties of their programs.