Link Details

Link 930497 thumbnail
User 225256 avatar

By mswatcher
via weblogs.asp.net
Submitted: Feb 26 2013 / 07:18

A coworker pointed me towards an interesting blog post 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). 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.
  • 1
  • 0
  • 96
  • 29

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (1)



Voters Against This Link (0)



    Java EE7
    Written by: Andrew Lee Rubinger
    Featured Refcardz: Top Refcardz:
    1. Design Patterns
    2. OO JS
    3. Cont. Delivery
    4. CI Patterns
    5. CI Tools
    1. Spring Integration
    2. Git
    3. Regex
    4. Java
    5. REST