<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>C# 4.0 on Bits and Pieces</title>
		<link>https://bits.strawjackal.org/tags/c%23-4.0/</link>
		<description>Recent content in C# 4.0 on Bits and Pieces</description>
		<generator>Hugo</generator>
		<language>en-us</language>
		
		
		
		
			<lastBuildDate>Mon, 25 Feb 2013 11:46:02 +0200</lastBuildDate>
		
			<atom:link href="https://bits.strawjackal.org/tags/c%23-4.0/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Not-So-Lazy Static Constructors in C# 4.0</title>
				<link>https://bits.strawjackal.org/71/</link>
				<pubDate>Mon, 25 Feb 2013 11:46:02 +0200</pubDate>
				<guid>https://bits.strawjackal.org/71/</guid>
				<description>&lt;p&gt;A &lt;a href=&#34;http://www.hmemcpy.com/blog/&#34;&gt;coworker&lt;/a&gt; pointed me towards an &lt;a href=&#34;http://msmvps.com/blogs/jon_skeet/archive/2010/01/26/type-initialization-changes-in-net-4-0.aspx&#34;&gt;interesting blog post&lt;/a&gt; by John Skeet about the changed behavior of static constructors in C# 4.0 (yes, I know, it’s been a few years now, but I never ran into it).&lt;/p&gt; &lt;p&gt;It seems that C# 4.0 now tries to be lazier when instantiated static fields. So if I have a side-effect free static method that doesn’t touch any members, calling it will not bother initializing the static fields. From Skeet’s post:&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
