Why are static classes considered “classes” and “reference types”?

前端 未结 10 1158
生来不讨喜
生来不讨喜 2021-02-01 04:54

I’ve been pondering about the C# and CIL type system today and I’ve started to wonder why static classes are considered classes. There are many ways in which they are not really

10条回答
  •  醉话见心
    2021-02-01 05:40

    Sure, they could have been made into a separate kind of thing.

    But that would have required additional work in the CLR, the BCL, and across the language teams, and I that would have left other, more important things undone.

    From a purely aesthetic point of view, I might agree with you.

提交回复
热议问题