Skip to Content
Effective C#: 50 Specific Ways to Improve Your C#, Third Edition
book

Effective C#: 50 Specific Ways to Improve Your C#, Third Edition

by Bill Wagner
December 2016
Intermediate to advanced
288 pages
9h 9m
English
Addison-Wesley Professional

Overview

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.

    Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
    and much more.

    Read now

    Unlock full access

    More than 5,000 organizations count on O’Reilly

    AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

    QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
    Julian F.
    Head of Cybersecurity
    QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
    Addison B.
    Field Engineer
    QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
    Amir M.
    Data Platform Tech Lead
    QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
    Mark W.
    Embedded Software Engineer

    You might also like

    More Effective C# (Includes Content Update Program): 50 Specific Ways to Improve Your C#, 2nd edition

    More Effective C# (Includes Content Update Program): 50 Specific Ways to Improve Your C#, 2nd edition

    Bill Wagner
    C# 9.0 in a Nutshell

    C# 9.0 in a Nutshell

    Joseph Albahari
    C# 7.0 in a Nutshell

    C# 7.0 in a Nutshell

    Joseph Albahari, Ben Albahari

    Publisher Resources

    ISBN: 9780134579290Purchase book