Re:Carnegie Mellon's intro functional programming lectures a...
by frozenlettuce on Monday November 20, 2023 @03:06PM
(#38353805)
yeah, I've been trying to get this mindset as well - even though sometimes I feel that I'm "cheating" :)
I work in OCaml, which is also a functional language, but prints can be added in single lines. I address this point in Lecture 19 (Imperative Programming), actually, but my perspective is -- we invented immutability and purity to serve us, but we need not be fanatically beholden to it. In my opinion, I think Haskell goes in that direction, when every usage of IO now needs the IO monad to get involved.
A little mutability is OK. Functional programming is about the avoidance of side effects, more than simply forbidding it.