by sarchertech · 3y ago · 0 comments
Disclaimer: I am the author of the article and am in the pocket of Big Comprehension
The map approach feels a lot more functional to me and is easy to chain. The `for` method feels a bit awkward. But that said I much prefer Ruby to Python. If I had the opposite preference, I'd probably like the `for` in Elixir more.
for x <- 1..10 do
IO.puts x
end
Isn't that a for loop?Outside of things like generating a game board, or some other well structured n-dimensional struct, I generally avoid nesting them, though. I’ll use Enum on the outer function(s) and filter for the inner one.