This is a concise yet thorough reference to C# 3.0 programming as implemented in Microsoft's Visual Studio 2008. "C# 3.0 in a Nutshell" gets right to the point, covering the essentials of language syntax and usage as well as the parts of the .NET base class libraries you need to build working applications. But unlike earlier editions, this book is now organized entirely around ...
This is a concise yet thorough reference to C# 3.0 programming as implemented in Microsoft's Visual Studio 2008. "C# 3.0 in a Nutshell" gets right to the point, covering the essentials of language syntax and usage as well as the parts of the .NET base class libraries you need to build working applications. But unlike earlier editions, this book is now organized entirely around concepts and use cases, providing greater depth and readability. C# 3.0 introduces the most significant enhancements yet to the programming language, and "C# 3.0 in a Nutshell" delves deep into the subject while assuming minimal prior knowledge of C# - making it accessible to anyone with a reasonable background in programming. In addition to the language, the book covers the .NET CLR and the core Framework assemblies, along with the unified querying syntax called Language Integrated Query (LINQ), which bridges the traditional divide between programs and their data sources.Free of clutter and long introductions, this book provides a map of C# 3.0 knowledge in a succinct and unified style: opening chapters concentrate purely on C#, starting with the basics of syntax, types and variables, and finishing with advanced topics such as unsafe code and preprocessor directives; later chapters cover the core . NET 3.5 Framework, including such topics as LINQ, XML, collections, I/O and networking, memory management, reflection, attributes, security, threading, application domains and native interoperability. Designed as a handbook for daily use, "C# 3.0 in a Nutshell" is an ideal companion to any of the vast array of books that focus on an applied technology such as WPF, ASP.NET, or WCF. The areas of the language and .NET Framework that such books omit, this one covers in detail.
原文摘录
· · · · · ·
• Conditionally including an attribute
• Changing the declared type of variable
• Switching between different namespaces or type aliases in a using directive—
for example:
using TestType =
#if V2
MyCompany.Widgets.GadgetV2;
#else
MyCompany.Widgets.Gadget;
#endif (查看原文)
A consequence of the last point is that a client should never specifically “catch” a contract failure (the ContractException type, in fact, is internal to help enforce that principle). Instead, the client should call the target properly; if it fails, this indicates a bug that should be handled via your general exception backstop (which may include terminating the application). In other words, if you decide control-flow or do other things based on a precondition failure, it’s not really a contract because you can continue executing if it fails.
This leads to the following advice when choosing between preconditions and throwing ordinary exceptions:
• If failure always indicates a bug in the client, favor a precondition.
• If failure indicates an abnormal condition, which may mean a bug in th... (查看原文)
这本书的作者是兄弟俩,哥哥 Joseph 是鼎鼎大名的 LINQPad 的作者,弟弟是前微软公司的 Program Manager。 本书涵盖了 C# 5.0 的最新特性,厚达 1064 页!亚马逊上评为 5 颗星。 编者写的介绍中,有这样一句话: Shaped by more than 20 expert reviewers, including Micros...
(展开)
0 有用 junjie.yao 2011-05-21 19:30:54
补充一下,下载到了一个chm电子版。
0 有用 sdhjl2000 2011-12-03 21:33:20
nutshell就是方便
0 有用 冬青 2011-12-18 16:41:47
难得的一本好书,属于C#进阶版的书籍,但建议英语的好看原文,中文翻译的那本有很多让人迷惑的地方。