re: Mere Functional Programming in F# VIEW POST

re: That's great to hear! I figured I couldn't be the only one who arrived at this style, regardless of language. That actually brings up a good point...

And in fact, a function can use mutation and still be deterministic as long as the mutations are local.

Yes, though it's not always the case in reality, many for loops have side effect in imperative programs :D

An interesting example of an improvement: Go loop variables are scoped within the loop, you can't access them from outside the loop.

For sure, it is otherwise normal to perform external side effects in for loops. Just to say that with some discipline it can be avoided. Though I think that way of doing things is pretty foreign to most of us.

code of conduct - report abuse