I was reading an old code blog from Jon Skeet: blog_link
In this blog, he talks about how types (without static constructors) are now initialized in a lazier way, in comparison to previous .NET versions.
Here’s what I don’t understand: Why does Jon Skeet say “Type Initialization” and not “Static Field Initialization”? Because as far as I know, that’s the only thing static constructors can do. When either a static member is referenced, or a class is instantiated, the static fields of the type are initialized (before anything in the static constructor is run).
To me, type initialization means a lot more than just initializing static fields. I feel like there’s some big I’m missing here. So, I’m wondering what “type initialization” really means here? Is it just initializing the static fields, or something more?
AhmedDaProgrammingBeast is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.