News for hackers. Stuff that matters.
Re:Elixir for Cynical Curmudgeons by throwawaymaths on Thursday August 03, 2023 @02:22PM (#36989665)
the problem with a for loop is that it is inexplicit about what from the outer scope can be mutated. Which isn't a problem, for small functions but I have definitely seen monster for loops in professionally written django code with ~500 lines of code in the function.

Besides being in that magical sweet spot (executes imperatively but reads declaratively), a reduce forces you to declare ahead of time what things can be carried over and mutated between each iteration.

> it can be controlled by processes and message passing.

DO NOT DO THIS YOU WILL REGRET THIS SIMCITY MEME

There are no comments on this comment yet.