When I started programming in Haskell, where all variables are immutable, I felt like I was in a straitjacket Then, suddenly, the enlightenment
John Carmack on mutable variables
161–170 of 663 posts
Re: John Carmack on mutable variables
#162Re: John Carmack on mutable variables
#163Earlier quoted context omitted.
As a Python programmer at day job, that is Clojure-curious and sadly only gets to use it for personal projects, and is currently threatened by an obnoxious TypeScript take over, I feel this.
Removing barriers to sloppy code is a language feature. That is why vibe coding, JavaScript and Python are so attractive.
Who needs to calculate load bearing supports, walls, and floors when you can just vibe oversize it by 50%.
Re: John Carmack on mutable variables
#164After a 2 year Clojure stint I find it very hard to explain the clarity that comes with immutability for programmers used to trigger effects with a mutation. I think it may be one of those things you have to see in order to understand.
Re: John Carmack on mutable variables
#165How fast this got to the top, you would think John Carmack just invented nuclear fusion.
Re: John Carmack on mutable variables
#166The value (pun intended) of the latter is that once you’ve arrived at a concrete result, you do not have to think about it again.
You’re not defining a “variable”, you’re naming an intermediate result.
Re: John Carmack on mutable variables
#167Re: John Carmack on mutable variables
#168Re: John Carmack on mutable variables
#169On a similar note, I’ve always liked the idea of being able to mark functions as pure (for some reasonable definition of pure). The principle of reducing state changes and side-effects feels a good one.
Whether it's of any actual utility is debatable