Hacker News new | past | comments | ask | show | jobs | submit login

Property 2 implies immutable state. I also used to think that was a great idea. Then I tried actually programming that way.



I’ve done most my programming in the past several years in Elixir, where mutable variables aren’t an option, and it’s been a great dev experience. An entire class of bugs disappears and it makes concurrency very easy to reason about.


After spending a few years in Erlang, it's hard (and depressing) to go back to any other way of programming.


I’ve written a lot of Clojure and Clojurescript over the past ~12 years and I find it a very natural way to program to the point that it’s the single biggest thing I miss when I work in other languages like javascript and Python.


Author here. State is not immutable, it is mutate-in-place via atomic swap. That makes it somewhat different than both functional programming and imperative programming, but it's not an excessively difficult programming style to use in practice.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: