Effective C# (Covers C# 6.0) (häftad)
Format
Häftad (Paperback)
Språk
Engelska
Antal sidor
288
Utgivningsdatum
2017-01-19
Upplaga
3
Förlag
Addison-Wesley Professional
Dimensioner
229 x 175 x 20 mm
Vikt
431 g
Antal komponenter
1
ISBN
9780672337871

Effective C# (Covers C# 6.0)

50 Specific Ways to Improve Your C#

Häftad,  Engelska, 2017-01-19
354
  • Skickas från oss inom 5-8 vardagar.
  • Fri frakt över 249 kr för privatkunder i Sverige.
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 editions 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.

Wagners 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 thats 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)
Youre 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.
Visa hela texten

Passar bra ihop

  1. Effective C# (Covers C# 6.0)
  2. +
  3. Co-Intelligence

De som köpt den här boken har ofta också köpt Co-Intelligence av Ethan Mollick (häftad).

Köp båda 2 för 544 kr

Kundrecensioner

Har du läst boken? Sätt ditt betyg »

Fler böcker av Bill Wagner

Recensioner i media

Praise for Effective C#, Second Edition

 

Being an effective .NET developer requires one to have a deep understanding of the language of their choice. Wagners book provides the reader with that knowledge via well-reasoned arguments and insight. Whether youre new to C# or youve been using it for years, youll learn something new when you read this book.

Jason Bock, Principal Consultant, Magenic

 

If youre at all like me, you have collected a handful of C# language pearls that have immediately transformed your abilities as a professional developer. What you hold in your hands is quite possibly the best collection of these tips that have ever been assembled. Bill has managed to exceed my wildest expectations with the latest edition in his eponymous Effective C#.

Bill Craun, Principal Consultant, Ambassador Solutions

 

Effective C#, Second Edition, is a must-read for anyone building high performance and/or highly scalable applications. Bill has that rare and awesome ability to take an amazingly complex problem and break it down into human, digestible, and understandable chunks.

Josh Holmes, Architect Evangelist, Microsoft

 

Bill has done it again. This book is a concise collection of invaluable tips for any C# developer. Learn one tip every day, and youll become a much better C# developer after fifty days!

Claudio Lassala, Lead Developer, EPS Software/CODE Magazine

 

A fountain of knowledge and understanding of the C# language. Bill gives insight to what happens under the covers of the .NET runtime based on what you write in your code and teaches pragmatic practices that lead to cleaner, easier to write, and more understandable code. A great mix of tips, tricks, and deep understanding . . . that every C# developer should read.

Brian Noyes, Chief Architect, IDesign Inc. (www.idesign.net)

 

Effective C# is a must-have for every C# developer. Period. Its pragmatic advice on code design is invaluable.

Shawn Wildermuth, Microsoft MVP (C#), Author, Trainer, and Speaker

 

In this book Bill Wagner provides practical explanations of how to use the most important features in the C# language. His deep knowledge and sophisticated communication skills illuminate the new features in C# so that you can use them to write programs that are more concise and easier to maintain.

Charlie Calvert, Microsoft C# Community Program Manager

Övrig information

<b>Bill Wagner</b> is one of the world s foremost C# developers and a member of the ECMA C# Standards Committee. He is president of the Humanitarian Toolbox, has been awarded Microsoft Regional Director and .NET MVP for 11 years, and was recently appointed to the .NET Foundation Advisory Council. Wagner has worked with companies ranging from start-ups to enterprises, improving the software development process and growing their software development teams. He is currently with Microsoft, working on the .NET Core content team. He creates learning materials for developers interested in the C# language and .NET Core. Bill earned a B.S. in computer science from the University of Illinois at Champaign-Urbana. Normal 0 false false false EN-US X-NONE X-NONE "

Innehållsförteckning

Introduction xiii

 

Chapter 1: C# Language Idioms 1

Item 1: Prefer Implicitly Typed Local Variables 1

Item 2: Prefer readonly to const 7

Item 3: Prefer the is or as Operators to Casts 12

Item 4: Replace string.Format() with Interpolated Strings 19

Item 5: Prefer FormattableString for Culture-Specific Strings 23

Item 6: Avoid String-ly Typed APIs 26

Item 7: Express Callbacks with Delegates 28

Item 8: Use the Null Conditional Operator for Event Invocations 31

Item 9: Minimize Boxing and Unboxing 34

Item 10: Use the new Modifier Only to React to Base Class Updates 38

 

Chapter 2: .NET Resource Management 43

Item 11: Understand .NET Resource Management 43

Item 12: Prefer Member Initializers to Assignment Statements 48

Item 13: Use Proper Initialization for Static Class Members 51

Item 14: Minimize Duplicate Initialization Logic 53

Item 15: Avoid Creating Unnecessary Objects 61

Item 16: Never Call Virtual Functions in Constructors 65

Item 17: Implement the Standard Dispose Pattern 68

 

Chapter 3: Working with Generics 77

Item 18: Always Define Constraints That Are Minimal and Sufficient 79

Item 19: Specialize Generic Algorithms Using Runtime Type Checking 85

Item 20: Implement Ordering Relations with IComparable<T> and IComparer<T> 92

Item 21: Always Create Generic Classes That Support Disposable Type Parameters 98

Item 22: Support Generic Covariance and Contravariance 101

Item 23: Use Delegates to Define Method Constraints on Type Parameters 107

Item 24: Do Not Create Generic Specialization on Base Classes or Interfaces 112

Item 25: Prefer Generic Methods Unless Type Parameters Are Instance Fields 116

Item 26: Implement Classic Interfaces in Addition to Generic Interfaces 120

Item 27: Augment Minimal Interface Contracts with Extension Methods 126

Item 28: Consider Enhancing Constructed Types with Extension Methods 130

 

Chapter 4: Working with LINQ 133

Item 29: Prefer Iterator Methods to Returning Collections 133

Item 30: Prefer Query Syntax to Loops 139

Item 31: Create Composable APIs for Sequences 144

Item 32: Decouple Iterations from Actions, Predicates, and Functions 151

Item 33: Generate Sequence Items as Requested 154

Item 34: Loosen Coupling by Using Function Parameters 157

Item 35: Never Overload Extension Methods 163

Item 36: Understand How Query Expressions Map to Method Calls 167

Item 37: Prefer Lazy Evaluation to Eager Evaluation in Queries 179

Item 38: Prefer Lambda Expressions to Methods 184

Item 39: Avoid Throwing Exceptions in Functions and Actions 188

Item 40: Distinguish Early from Deferred Execution 191

Item 41: Avoid Capturi...