About 20 years ago, I remember reading the original 10 commandments for C programmers.  A lot of time has elapsed since then, and there are some things that needed to change as technology and experience have changed the developer’s world.

So here is my modernized version for the sect of Microsoft C# developers in the world.

The Ten Commandments for C# Programmers

  1. Thou shalt enable ReSharper and study and obey its pronouncements with care, for verily its perception and judgment doth exceed thine own.
  2. Thou shalt not override the Dispose method of a class without just cause, nor shalt thou attempt to tame the Dragon of old known as “mutex”, for yea thou shalt surely be greeted by chaos and madness at execution time.
  3. Thou shalt faithfully force a cast upon an foreign object, lest it take cruel vengeance upon thee when thou least expect it.
  4. Thou shalt carefully consider thine host servers and their environment before committing thy design to code, lest the false glory of thine own workstation lead thee astray from the truth.
  5. Thou shalt exercise care with boundaries and encoding of all data entry points, for surely where thou processeth “foo” now, there also shalt thou someday process  “ما في العالم أستطيع أن أكتب هنا“.
  6. Thou shalt avoid the wide road to destruction by unhandled exception, and ensure that thine code snare any exception and rebuke it swiftly and decisively, yea that thine execution times may be long and prosperous. For if thou thinkest “thus can it not happen to me'”, the god of Murphy shall surely punish thee for thy arrogance by heralding  thy childest oversight directly to Microsoft itself.
  7. Thou shalt study thy tools and existing assemblies and strive not to reinvent them without cause, that thy code may be short and readable and thy days pleasant and productive.
  8. Thou shalt learn to “speak in keys” (Ctrl+K,D) to make thy neighbor’s bracing style clear to thyself, and renounce the false god known as “The One True Brace Style”, for what doth thy coding time better serve: the understanding and solving of problems, or the understanding of the demons of thy fellow coder.
  9. Thou shalt not include nor reference the  project from a neighboring tribesman’s solution into thine own tribe’s solution, excepting that thou compile that project source into a working and tested assembly. For curseth is the coder, that forseeth not that thy neighboring tribesman shall eventually seek to make his carriage wheel better and, when he faileth, shalt also break thine horse cart as well.
  10. Thou shalt foreswear, renounce, and abjure the vile heresy which claimeth that “All the world’s a 32-bit machine”, and have no commerce with the self-benighted managers who cling to this barbarous belief, that the days of thy code (and resume) may be long even though the days of thy current machine be short.