Ray's playground

 

2011年1月18日

Item 11: Understand the Attraction of Small Functions(Effective C#)

摘要: Remember that translating your C# code into machine-executable code isa two-step process. The C# compiler generates IL that gets delivered inassemblies. The JIT compiler generates machine code for each method (orgroup of methods, when inlining is involved), as needed. Small functionsmake it much eas 阅读全文

posted @ 2011-01-18 23:29 Ray Z 阅读(208) 评论(0) 推荐(0) 编辑

Item 10: Use Optional Parameters to Minimize Method Overloads(Effective C#)

摘要: Therefore, adding parameters, even if they are optional parameters, is abreaking change at runtime. If they have default values, it’s not a breakingchange at compile time.  Now, after that explanation, the guidance should be clearer. For your initialrelease, use optional and named parameters to crea 阅读全文

posted @ 2011-01-18 21:16 Ray Z 阅读(207) 评论(0) 推荐(0) 编辑

XPath: A Syntax for Describing Needles and Haystacks(Chapter 3 of XSLT 2nd Edition)

摘要: There are seven kinds of nodes in XPath:  • The document node (one per document)  • Element nodes  • Attribute nodes  • Text nodes  • Comment nodes  • Processing instruction nodes  • Namespace nodes 阅读全文

posted @ 2011-01-18 21:03 Ray Z 阅读(140) 评论(0) 推荐(0) 编辑

导航