Why does Microsoft advise against readonly fields with mutable values?

前端 未结 7 899
予麋鹿
予麋鹿 2020-12-28 12:34

In the Design Guidelines for Developing Class Libraries, Microsoft say:

Do not assign instances of mutable types to read-only fields.

7条回答
  •  旧时难觅i
    2020-12-28 13:28

    In the end they are just guidelines. I know for a fact that the people at Microsoft often don't follow all of the guidelines.

提交回复
热议问题