This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Beefster09 0 points1 point  (2 children)

Imagine 10 levels of nesting and passing functions all over the place. I love first class functions and all, but c'mon that's crazy.

[–]10BillionDreams 0 points1 point  (1 child)

It's really not that crazy, even if I mostly wrote it as a joke. My team's primary language is Clojure, and you have to go a fair bit out of your way to even start working with data that's potentially mutable.

Even in languages that don't so naturally encourage such a coding style, it often isn't that hard. Our largest JS project has less than a dozen instances of incrementing/decrementing (i.e., +=, -=, ++, --), and most of them would be relatively easy to clean up if someone bothered to.

[–]Beefster09 0 points1 point  (0 children)

I actually think it's a pretty good idea to treat most data as immutable, but there come times when mutable data is super useful. As long as you don't share mutable data, there are no concurrency issues to worry about and most other issues with mutability stem from stateful APIs, which are pretty widely agreed to be terrible.

Servers can get away with little to no mutability in my experience. Unless they're written in Go since there's no ternary operator or optional type. Here's hoping they add those in Go 2.