4 ms·
Many design decisions are based on keeping the language simple in syntax and semantics.
by chkas 8y ago
Many design decisions are based on keeping the language simple in syntax and semantics.
- pmarreck 8y agoI have found that immutability is actually simpler to understand (and, potentially related, results in fewer bugs per LOC written), it's just that everyone's (including mine!) first language is usually procedural/mutable so that seems to be what is "easy"
- davegauer 8y agoI can't fathom why you've been downvoted. I think you're absolutely correct: there's nothing "obvious" about either flavor. It's really clear, in hindsight, why we started out with mutability (and self-modifying code and all sorts of "crazy" bit-twiddling goodies from the age of hardware-specific software). But I don't think it takes too much imagination to envision a world in which immutability becomes the default, even (or especially) for beginners!
- pmarreck 8y agoNow that RAM is relatively cheap and garbage collection algos are pretty decent, immutability should be the default, because it eliminates an entire class of bugs while enabling benefits like "easy" lock-free concurrency, etc. Here's a project I'm excited about, I think it's the first fully-functional/immutable/declarative cross-platform GUI library in existence https://github.com/boydm/scenic https://github.com/boydm/scenic Still pretty rudimentary but has made great strides in a year and the demo is pretty amazing (especially given how NOTORIOUSLY gui toolkits are typically OOP/procedural/mutable) https://www.youtube.com/watch?v=1QNxLNMq3Uw https://www.youtube.com/watch?v=1QNxLNMq3Uw Boyd Multerer got famous via Xbox Live.