Twitter GitHub Facebook Instagram

Daniel Irvine on building software

What if....?

15 July 2010

What if C#....

  • had no properties?
  • had only private fields?
  • fields were readonly by default?
  • had no mutable static fields?
  • had no static methods or static classes?
  • prohibited passing null as method parameters?
  • integrated specs/test with code, in the same file?
  • only allowed one class per file?
  • prohibited nested classes?
  • had syntax distinguishing between class dependencies and notifications with special syntax?
  • enforced command-query separation from methods?
Some of these ideas are almost unworkable, some are fundamental to the cause and some are just “my style”.  In a future post I’ll go over each in detail and see how they can be implemented--maybe I’ll just hack a few FxCop rules together and be done with it.

About the author

Daniel Irvine is a software craftsman at 8th Light, based in London. These days he prefers to code in Clojure and Ruby, despite having been a C++ and C# developer for the majority of his career.

For a longer bio please see To contact Daniel, send a tweet to @d_ir or use the comments section below.

Twitter GitHub Facebook Instagram