Effective C# : 50 Specific Ways to Improve Your C#(Covers C# 6.0), 3/e (Paperback)
暫譯: 有效的 C#:50 種具體方法提升你的 C#(涵蓋 C# 6.0),第 3 版(平裝本)

Bill Wagner

買這商品的人也買了...

商品描述

In Effective C#, Third Edition, respected .NET expert Bill Wagner identifies 50 ways to harness the full power of the C# 6.0 language to write exceptionally robust, efficient, and well-performing code. Reflecting the growing sophistication of the C# language and its development community, Wagner has identified dozens of new ways to write better code. This edition’s new solutions include some that take advantage of generics and several that are more focused on LINQ, as well as a full chapter of advanced best practices for working with exceptions.

 

Wagner’s clear, practical explanations, expert tips, and realistic code examples have made Effective C# indispensable to hundreds of thousands of developers. Drawing on his unsurpassed C# experience, he addresses everything from resource management to multicore support, and reveals how to avoid common pitfalls in the language and its .NET environment. Learn how to choose the most effective solution when multiple options exist, and how to write code that’s far easier to maintain and improve. Wagner shows how and why to


  • Prefer implicitly typed local variables (see Item 1)
  • Replace string.Format() with interpolated strings (see Item 4)
  • Express callbacks with delegates (see Item 7)
  • Make the most of .NET resource management (see Item 11)
  • Define minimal and sufficient constraints for generics (see Item 18)
  • Specialize generic algorithms using runtime type checking (see Item 19)
  • Use delegates to define method constraints on type parameters (see Item 23)
  • Augment minimal interface contracts with extension methods (see Item 27)
  • Create composable APIs for sequences (see Item 31)
  • Decouple iterations from actions, predicates, and functions (see Item 32)
  • Prefer lambda expressions to methods (see Item 38)
  • Distinguish early from deferred execution (see Item 40)
  • Avoid capturing expensive resources (see Item 41)
  • Use exceptions to report method contract failures (see Item 45)
  • Leverage side effects in exception filters (see Item 50)


You’re already a successful C# programmer, and this book will make you an outstanding one.

 

Content Update Program: This book is part of the InformIT Content Update Program. As updates are made to C#, sections of this book will be updated or new sections will be added to match updates to the technologies. See inside for details.

商品描述(中文翻譯)

在《有效的 C#,第三版》中,受人尊敬的 .NET 專家比爾·瓦格納(Bill Wagner)指出了 50 種利用 C# 6.0 語言的全部功能來編寫異常穩健、高效且表現良好的代碼的方法。反映出 C# 語言及其開發社群日益增長的複雜性,瓦格納已經找出了數十種改進代碼的全新方法。本版的新解決方案包括一些利用泛型的解決方案,以及幾個更專注於 LINQ 的解決方案,還有一整章關於處理異常的進階最佳實踐。

瓦格納清晰、實用的解釋、專家的建議和現實的代碼範例使《有效的 C#》成為數十萬開發者不可或缺的資源。憑藉他無與倫比的 C# 經驗,他涵蓋了從資源管理到多核心支持的各個方面,並揭示了如何避免語言及其 .NET 環境中的常見陷阱。學習在多種選擇存在時如何選擇最有效的解決方案,以及如何編寫更易於維護和改進的代碼。瓦格納展示了如何以及為什麼要:

- 偏好隱式類型的局部變數(見第 1 項)
- 用插值字串替換 string.Format()(見第 4 項)
- 用委派表達回調(見第 7 項)
- 充分利用 .NET 資源管理(見第 11 項)
- 為泛型定義最小和足夠的約束(見第 18 項)
- 使用運行時類型檢查專門化泛型算法(見第 19 項)
- 使用委派在類型參數上定義方法約束(見第 23 項)
- 用擴展方法增強最小介面合約(見第 27 項)
- 為序列創建可組合的 API(見第 31 項)
- 將迭代與行動、謂詞和函數解耦(見第 32 項)
- 偏好 lambda 表達式而非方法(見第 38 項)
- 區分早期執行與延遲執行(見第 40 項)
- 避免捕獲昂貴的資源(見第 41 項)
- 使用異常來報告方法合約失敗(見第 45 項)
- 在異常過濾器中利用副作用(見第 50 項)

你已經是一位成功的 C# 程式設計師,而這本書將使你成為一位傑出的程式設計師。

內容更新計畫:本書是 InformIT 內容更新計畫的一部分。隨著 C# 的更新,本書的部分內容將會更新或新增部分以符合技術的更新。詳情請參見內頁。