Why should I avoid using Properties in C#?

后端 未结 14 538
渐次进展
渐次进展 2020-12-22 18:05

In his excellent book, CLR Via C#, Jeffrey Richter said that he doesn\'t like properties, and recommends not to use them. He gave some reason, but I don\'t really understand

14条回答
  •  萌比男神i
    2020-12-22 18:25

    That reason must have been given within a very specific context. It's usually the other way round - it is recomended to use properties as they give you a level of abstraction enabling you to change behaviour of a class without affecting its clients...

提交回复
热议问题