3 ms·
That makes no sense. Maps and closures are tools like any other. Just as with many other tools, they are powerful, and should be used WHEN APPROPRIATE. With ma
by deanCommie 11y ago
That makes no sense. Maps and closures are tools like any other. Just as with many other tools, they are powerful, and should be used WHEN APPROPRIATE.
With maps, for instance, yes generally declarative programming is preferable to imperative programming (http://stackoverflow.com/questions/1784664/what-is-the-difference-between-declarative-and-imperative-programming http://stackoverflow.com/questions/1784664/what-is-the-diffe...)
However, I've seen monster Java8 stream and C# LINQ statements that would benefit from additional intermediary variables, helper functions, and even cases where loops make things more clear.
- weinzierl 11y agobtuilly probably meant map as in mapreduce not map as in hashmap.
- lostcolony 11y agoBtilly rather clearly meant it in the sense of the higher order function (from which mapreduce gets its name), a fact deanCommie clearly grasped.
- hueving 11y ago>Just as with many other tools, they are powerful, and should be used WHEN APPROPRIATE. You can't work in a vacuum on large projects. To be an effective engineer you have to understand the limitations of your team members. Forgoing map in lieu of a more verbose loop is completely appropriate if you're working with a bunch of junior people that need to maintain and fix bugs in the same codebase.
- stickfigure 11y agoI didn't downvote you, but I'm guessing the reason for your downvotes is that in this day and age, even junior programmers should be expected to understand map. It's such a simple concept that anyone who writes code for a living should be reasonably expected to understand it. If you're on a team with a bunch of programmers and nobody understands map, GTFO. It will not end well.
- wtetzner 11y agoIn fact, map is simpler than a loop.