Hacker News new | ask | show | jobs
by edwinnathaniel 3129 days ago
But "immutable" way of doing things have been encouraged, suggested, marked-in-stone as best-practices in most languages since 2005... am I missing something?

People have been saying that:

- Global Object is bad

- Stateless is better than Stateful

- Singleton becomes an anti-pattern

- Methods/Functions without side-effect (avoid mutation)

Nobody really mentioned to do things the Functional programming way per-se but the characteristics are there.

1 comments

Immutable programming with proper immutable data structures (i.e. persistent) is very different than immutable programming in a language with lots of constructs for mutation.

You can throw "const" on things but that isn't really the same kind of immutable programming that exists in Clojure.

Because immutable programming is not just about data not changing, it's about the transformations you can do on that data without concern for the costs that would arise if you did those same transformations in a language without immutable data structures.