Skip to Content
Effective C# (Covers C# 4.0): 50 Specific Ways to Improve Your C#, Second Edition
book

Effective C# (Covers C# 4.0): 50 Specific Ways to Improve Your C#, Second Edition

by Bill Wagner
March 2010
Intermediate to advanced
352 pages
8h 16m
English
Addison-Wesley Professional

Overview

C# has matured over the past decade: It’s now a rich language with generics, functional programming concepts, and support for both static and dynamic typing. This palette of techniques provides great tools for many different idioms, but there are also many ways to make mistakes. In Effective C#, Second Edition, respected .NET expert Bill Wagner identifies fifty ways you can leverage the full power of the C# 4.0 language to express your designs concisely and clearly.

Effective C#, Second Edition, follows a clear format that makes it indispensable to hundreds of thousands of developers: clear, practical explanations, expert tips, and plenty of realistic code examples. Drawing on his unsurpassed C# experience, Wagner addresses everything from types to resource management to dynamic typing to multicore support in the C# language and the .NET framework. Along the way, he shows how to avoid common pitfalls in the C# language and the .NET environment. You’ll learn how to

  • Use both types of C# constants for efficiency and maintainability (see Item 2)

  • Employ immutable data types to promote multicore processing (see Item 20)

  • Minimize garbage collection, boxing, and unboxing (see Items 16 and 45)

  • Take full advantage of interfaces and delegates (see Items 22 though 25)

  • Make the most of the parallel framework (see Items 35 through 37)

  • Use duck typing in C# (see Item 38)

  • Spot the advantages of the dynamic and Expression types over reflection (see Items 42 and 43)

  • Assess why query expressions are better than loops (see Item 8)

  • Understand how generic covariance and contravariance affect your designs (see Item 29)

  • See how optional parameters can minimize the number of method overloads (see Item 10)

  • You’re already a successful C# programmer–this book will help you become an outstanding one.

    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

    Effective C#: 50 Specific Ways to Improve Your C#

    Effective C#: 50 Specific Ways to Improve Your C#

    Bill Wagner

    Publisher Resources

    ISBN: 0321659112Publisher Website