Should I always/ever/never initialize object fields to default values?

前端 未结 17 2112
臣服心动
臣服心动 2020-12-09 14:49

Code styling question here.

I looked at this question which asks if the .NET CLR will really always initialize field values. (The answer is yes.) But it

17条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-09 15:32

    I always initialize fields explicitly in the constructor. For me, it's THE place to do it.

提交回复
热议问题