摘自博客 


编写高质量代码改善C#程序的157个建议——

  1. 减少/避免装箱操作  
  2. 使用默认转型方法 
  3. 强制转型 VS as,is 
  4. TryParse > Parse 
  5. 使用值为空的int类型:Nullable<int> i = null /int? i = null (T?是Nullable<T>是缩写)

相关文章: