Item 4: Use Conditional Attributes Instead of #if(Effective C#)
2011-01-09 22:31
483 查看
The Conditional attribute generates more efficient IL than #if/#endif does. It also has the advantage of being applicable only at the function level, which forces you to better structure your conditional code. The compiler uses the Conditional attribute to help you avoid the common errors we have all made by placing the #if or #endif in the wrong spot. The Conditional attribute provides better support for you to cleanly separate conditional code than the preprocessor did.
相关文章推荐
- Item 4:Use Conditional Attributes Instead of #if
- Effective C# Item 4: Use Conditional Attributes Instead of #if
- Item 4: Use Conditional Attributes Instead of #if
- Effective C# 4:use conditional attributes instead of #if
- Use Conditional Attributes instead of #if - Effective C#学习笔记(4)
- Item 1: Use Properties Instead of Accessible Data Members(Effective C#)
- Effective C# Item 1: Always Use Properties Instead of Accessible Data Members
- 《Effective C#》Item 4:使用Conditional属性来代替IF/ENDIF程序块
- Item 1: 尽可能的使用属性代替可访问的数据成员(Always Use Properties Instead of Accessible Data Members)
- 转:Effective C#》Item 4:使用Conditional属性来代替IF/ENDIF程序块
- Item 1: Use Properties Instead of Accessible Data Members
- Effective C# 1:Always Use Properties Instead of Accessible Data Members
- 《Effective C#》Item 4:使用Conditional属性来代替IF/ENDIF程序块
- An effective way to use pattern to instead of multiple if else statements
- Item 39: Use Dynamic to Leverage the Runtime Type of Generic Type Parameters(Effective C#)
- Effective Objective-C 2.0:Item 50: Use NSCache Instead of NSDictionary for Caches
- Item 1:Always Use Properties Instead of Accessible Date Members
- Use Exception.ToString() instead of Exception.Message.
- Item 16: Use the same form in corresponding uses of new and delete.(Effective C++)
- When to Use Delegates Instead of Interfaces