Empirical data on the effects of immutability?

后端 未结 9 550
长情又很酷
长情又很酷 2021-01-01 19:03

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++ b

9条回答
  •  旧时难觅i
    2021-01-01 19:50

    What would you objectively measure? GC and object count could be measured with mutable/immutable versions of the same program (although how typical that would be would be subjective, so this is a pretty weak argument). I can't imagine how you could measure the removal of threading bugs, except maybe anecdotally by comparison with a real world example of a production application plagued by intermittent issues fixed by adding immutability.

提交回复
热议问题