2 ms·
What map returns greatly depends on lambda inside. So yoir collection of beans is changing into collection of good knows what and you have to keep while chainin
by watwut 6y ago
What map returns greatly depends on lambda inside. So yoir collection of beans is changing into collection of good knows what and you have to keep while chaining in mind - because it is nowhere visible.
- nepeckman 6y agoWhatever exists inside the map lambda would have to exist inside the for loop as well. So if you're dealing with a confusing transformation, a loop doesnt offer you any extra tools for making that transformation more apparent to the reader. Loops have plenty of advantages (computer execution is more obvious, stack traces can be cleaner, easier concept for beginners to grasp), but I have never seen a loop be more readable than a well written functional composition.
- watwut 6y agoYes and it tends to be more apparent what is its type. It also tends to have a name that helps understanding a lot . It is not even primary loop vs stream difference. This particular frustration is the fluent api vs procedural difference. It is chaining that obfuscates in this case. Through, I really don't find functional style more readable in general.