Item 4: Use Conditional Attributes Instead of #if(Effective C#)
转载 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 5: Always Provide ToString()(Effective C#)
下一篇:Item 3: Prefer the is or as Operators to Casts(Effective C#)
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章