Empirical data on the effects of immutability?
问题 In class today, my professor was discussing how to structure a class. The course primarily uses Java and I have more Java experience than the teacher (he comes from a C++ background), so I mentioned that in Java one should favor immutability. My professor asked me to justify my answer, and I gave the reasons that I've heard from the Java community: Safety (especially with threading) Reduced object count Allows certain optimizations (especially for garbage collector) The professor challenged