3 ms·
Define what you mean by "everyone" -- there are times where the cost of immutability can be overwhelming, such as in high traffic systems with overly complex da
by dianeb 2y ago
Define what you mean by "everyone" -- there are times where the cost of immutability can be overwhelming, such as in high traffic systems with overly complex data structures which you are required to use because someone who should have known better insisted upon writing.
(sorry, bitter personal experience) And yes, that is explicitly "modern" Java code written by a lead engineer and "java champion" in 2023.
- deepsun 2y agoYes, I feel you. As I said, we often need to sacrifice immutability to performance, and that's ok. If they insisted using immutable structures in high-performance applications, then functional programming won't help anyway.
- fhasdfyuasd 2y agoHopefully we won't have to make that trade off for too long https://www.microsoft.com/en-us/research/uploads/prod/2020/11/perceus-tr-v1.pdf https://www.microsoft.com/en-us/research/uploads/prod/2020/1...
- codethief 2y agoCame here to write this. There's also a (research) language that uses the Perceus algorithm: https://koka-lang.github.io/ https://koka-lang.github.io/
- deepsun 2y agoEven reference counting needs memory management. Granted, allocations are very fast on the JVM heap, but cannot be faster than no allocations.