RSS Amplifier

omervk.com · Aug 19, 2008

Pitfall: Static Field Inline Initialization Order of Execution

0
Sign in to vote or save

This page cannot be shown here. You can still read it on the original site — the toolbar below keeps your place in the directory.

Here’s something I fell into today. You have a class that has some members that need to be calculated once. So you use static readonly fields. One of those members is a calculation of some of those members. Take the following code for instance:… 
 You can read the copy of the original post , or if that goes down too, you can try the Wayback Machine ’s copy of it. 
 Context:…

Here’s something I fell into today. You have a class that has some members that need to be calculated once. So you use static readonly fields. One of those members is a calculation of some of those members. Take the following code for instance:…

You can read the copy of the original post, or if that goes down too, you can try the Wayback Machine’s copy of it.

Context: This post was automatically imported from my old blog, which was originally hosted on Microsoft’s ASP.NET Community Blogs. When they shut it down, I dumped all of my old posts to Wordpress. You can still check out the original blog on the Wayback Machine.

Read on /posts/2008-08-19-pitfall-static-field-inline-initialization-order-of-execution/

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.