.net miner

something about life, me and .net
  • Home
  • Categories
    • C#
    • .Net
    • Tools
    • General
    • Visual Studio
    • Open Source Projects
  • Contact Me
.Net•C#

Switch vs If

16 May 2008 by Ozcan Degirmenci No Comments
Switch vs IF

An example screenshot of the Switch ve IF

Most of the people know that switch works like if-else blocks. The only difference between the switch and if-else is its being for the many conditional states, and also writing switch is more simple than if-else block. This knowledge is really a big   mistake  because switch has a different algorithm and working-procedure comparing to if-else block. To demonstrate this, I wrote a simple example which indicates the performance differences between switch and if-else in many different situations.

Continue reading

Share:
Reading time: 9 min
.Net•C#

What Is The Best Way For Declaring Static Fields

25 April 2008 by Ozcan Degirmenci No Comments

Today I wrote a simple application, which shows what the difference is between initializing a static field in the explicit static constructor and doing the same during the declaration time (inline). I know that even when we initialize our static fields inline, the compiler will add an implicit static constructor to that class and initialize static values in that method. But this example showed me that there is really a long time difference between initializing static fields inline and in explicit static constructor. Here are a screenshot from the example – in this example BeforeFieldInit means that the static fields are initialized inline and NotBeforeFieldInit means that static fields are initialized in the explicit static constructor:

Continue reading
Share:
Reading time: 3 min
Page 2 of 2«12

Search

Projects

  • Process Viewer
  • B-Msn
  • Runtime Member Proxies
  • Searchable RichTextBox

Categories

  • .Net (19)
  • C# (12)
  • General (13)
  • Open Source Projects (4)
  • Quantum (1)
  • Tools (9)
  • Visual Studio (6)

Archives

  • November 2018
  • September 2018
  • September 2010
  • August 2010
  • August 2009
  • September 2008
  • August 2008
  • June 2008
  • May 2008
  • April 2008
  • February 2008
  • January 2008

About me

Hi, my name is Ozcan Degirmenci. I'm co-founder and CEO at Crs Soft.

Tags

Assembly Collection Editor Dialog Support Dynamic method enum Flag Editor Loader Exceptions Ole Calls Open source project open source projects Perfornance Comparison process viewer Proxy quantum Reflection Run Apps From Web schrödinger's cat Searchable Richtextbox Spoon thought experiment thread

© 2018 copyright ÖZCAN DEĞİRMENCİ // All rights reserved.