Effective C# and over one million other books are available for Amazon Kindle. Learn more



or
Sign in to turn on 1-Click ordering
Sell Us Your Item
For a $6.63 Gift Card
Trade in
More Buying Choices
Have one to sell? Sell yours here
Start reading Effective C# on your Kindle in under a minute.

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.
Sorry, this item is not available in
Image not available for
Color:
Image not available

To view this video download Flash Player

 

Effective C# (Covers C# 4.0): 50 Specific Ways to Improve Your C# (2nd Edition) (Effective Software Development Series) [Paperback]

Bill Wagner
4.4 out of 5 stars  See all reviews (38 customer reviews)

List Price: $44.99
Price: $25.04 & FREE Shipping. Details
You Save: $19.95 (44%)
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
Only 13 left in stock (more on the way).
Ships from and sold by Amazon.com. Gift-wrap available.
Want it Wednesday, May 29? Choose One-Day Shipping at checkout. Details
Free Two-Day Shipping for College Students with Amazon Student

Formats

Amazon Price New from Used from
Kindle Edition $16.20  
Paperback $25.04  
Amazon.com Textbooks Store
Shop the Amazon.com Textbooks Store and save up to 70% on textbook rentals, 90% on used textbooks and 60% on eTextbooks.

Book Description

March 15, 2010 0321658701 978-0321658708 2

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.


Frequently Bought Together

Effective C#  (Covers C# 4.0): 50 Specific Ways to Improve Your C# (2nd Edition) (Effective Software Development Series) + More Effective C#: 50 Specific Ways to Improve Your C# + C# in Depth, Second Edition
Price for all three: $90.03

Buy the selected items together


Editorial Reviews

Review

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

–Jason Bock, Principal Consultant, Magenic

 

“If you’re 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 you’ll 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–including things true since C# 1.0 up through new capabilities in C# 4.0–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

About the Author

With more than twenty years of experience, Bill Wagner, SRT Solutions cofounder, is a recognized expert in software design and engineering, specializing in C#, .NET, and the Azure platform. He serves as Michigan’s Regional Director for Microsoft and is a multiyear winner of Microsoft’s MVP award. An internationally recognized writer, Bill is the author of the first edition of this book and More Effective C# (Addison-Wesley, 2009) and currently writes a column on the Microsoft C# Developer Center. Bill earned a B.S. in computer science from the University of Illinois at Champaign-Urbana.


Product Details

  • Paperback: 352 pages
  • Publisher: Addison-Wesley Professional; 2 edition (March 15, 2010)
  • Language: English
  • ISBN-10: 0321658701
  • ISBN-13: 978-0321658708
  • Product Dimensions: 7.1 x 0.8 x 9.1 inches
  • Shipping Weight: 1.3 pounds (View shipping rates and policies)
  • Average Customer Review: 4.4 out of 5 stars  See all reviews (38 customer reviews)
  • Amazon Best Sellers Rank: #161,455 in Books (See Top 100 in Books)

More About the Authors

Discover books, learn about writers, read author blogs, and more.

Customer Reviews

I recommend this book to any intermediate and above developer. Andrew  |  9 reviewers made a similar statement
Thanks, Bill for credibly extending Scott Meyer's fine series with your excellent entry! John Tobler  |  6 reviewers made a similar statement
Most Helpful Customer Reviews
18 of 19 people found the following review helpful
5.0 out of 5 stars A new edition brings new insight to C# on .NET 4.0 April 27, 2010
Format:Paperback|Amazon Verified Purchase
I have both editions of "Effective C#". The older, first edition did not have lambda expressions, LINQ, or generics (though it hinted at generics towards the end). In the second edition, tips (called "Items") that have since fallen out of practice are weeded out and are replaced with fresh concepts from .NET 2.0, through 4.0.

The items are written in a very clear manner. Most of the figures are illustrative of the concepts. Some of the pictures aren't quite as clear as they could be (.NET's Garbage Collector sticks out in my mind - Bill! read some Tufte! :) but for the most part, each item gave a firm understanding. I could read the first and last paragraph of each item to get a clear bird's eye explanation. Later, I would pore over the details with a highlighter and come away enlightened.

This book has a sister - "More Effective C#". This was released PRIOR to "Effective C# - Second Edition". I own that copy too, and it's dog-eared by now. The two books go together like peas and carrots, though "More Effective C#" touches on more advanced .NET 3.0 concepts. "More Effective C#"'s treatment of "yield return", dependency injection, and composition in the third chapter alone are inspiring.

If you really want to go all out, I'd recommend getting "C# in Depth" by John Skeet. There's a new edition coming out in the summer of 2010. Skeet's book will bring the reader up to speed on the advancements of C# in .NET 3.0 (and soon 4.0) without giving them any specific tips. The "Effective C#" series will give the reader specific tips without bringing anybody up to speed.

Also, the author is a cool guy. I emailed him back in 2009 with questions about the first edition and he brought me up to speed by responding on his blog. You are encouraged to give him feedback.

I consider "Effective C#" as one of the first books I reach when I want to brush up on my skill set.
Comment | 
Was this review helpful to you?
28 of 32 people found the following review helpful
Format:Paperback|Amazon Verified Purchase
I should be clear, I am not criticizing this book as being "bad", but it turns out to have been the least useful C# book I've purchased. This is admittedly in part due to my own preferences and perceptions about what I need from various C# books.

There is a quote from Alice in Wonderland that I find quite applicable here:
Alice: Would you tell me, please, which way I ought to go from here?
The Cat: That depends a good deal on where you want to get to.

This quote kept coming to mind as I read through all 50 tips. They aren't really tips so much as, well, good ideas, assuming what the author is describing is what you want to do. If it isn't what you want to do, any given tip is either not applicable, or actually a bad idea.

I found myself thinking, about each tip, one of three things:
1) Well, yes, of course, that's a good best practice. For most of these, I already knew that. The only one that impressed me was using readonly vs const: it was a good overall explanation of how const can backfire.
2) Um, no, that really isn't true, though a lot of people think it is. In particular his discussion of StringBuilder vs string concatenation was much less enlightening than googling for the topic and reading useful forum/blog posts.
3) Um, I guess that's a good idea, assuming that's what you intend to do in the first place. (Most of the book fit into this category for me.)

So I find myself reading tips that are either really obvious, or I believe they're wrong or slightly misinformed, or they really don't apply to anything I need to do at all. The author appears to use C# mostly to write APIs that would be used generally by others, e.g., more on the "web service" side than the "web application" side. If your goal is to write APIs, you may very well find these tips to be much more useful than I do. The tips aren't "wrong", but as I find myself usually writing applications instead of APIs, they don't explain anything that I'd actually use. Other tips discuss architecture decisions that would never come up for the person who is merely responsible for implementing them: this is sometimes useful, but really, architecture decisions are entirely dependent on what you want the application to do (queue the Alice quote again).

I would suggest that his worst tip is the one where he briefly discusses the StringBuilder vs string concatenation debate. The tip is to not create unnecessary objects. This is certainly a valid concern. He doesn't really weigh the advantages/disadvantages, rather he simply asserts that StringBuilder is better because fewer objects are created for the garbage collector to collect. I don't want to belabor the already-well-known-and-easily-googled discussions on the matter, but suffice it to say, the real answer is "it depends". Sometimes StringBuilder is clearly the best choice. Sometimes simple string concatenation is clearly superior (the garbage collector really is very smart about how to handle the extra strings that are orphaned by concatenation, so long as you don't abuse it). And String.Format really isn't all that advantageous, either, unless you need special/complex formatting, because it goes and creates a new StringBuilder (with associated overhead and requiring garbage collection) every time you call it.

"Would you tell me, please, which way I ought to [code] from here?" asked Alice. "That depends a good deal on where you want to get to," replied the Cat.

I would steer those who are looking for expert-level knowledge about how C# "really works" to check out Jon Skeet's "C# in Depth, Second Edition", also available from Amazon. It covers many of the same topics, but I believe it provides a deeper understanding of C# such that you don't need any "specific tips", but rather the correct course of action becomes obvious based on the circumstances at hand.
Was this review helpful to you?
29 of 36 people found the following review helpful
1.0 out of 5 stars Poor Kindle Edition July 12, 2011
Format:Kindle Edition|Amazon Verified Purchase
The Kindle edition uses different font weights so that the text is shown differently from the code.
a) A normal black for the text; and
b) a completely invisible grey for the code.
If you have any desire to actually see the code in this book, don't bother with the Kindle edition.
The conversion was very shoddy.
Was this review helpful to you?
Most Recent Customer Reviews
5.0 out of 5 stars Very informative, easy to read
This book is very informative, easy to read, and follow. We use it at work in group sessions, it is good for "work classes" - highly recommend!
Published 11 days ago by Amanda L. Fratturelli
5.0 out of 5 stars Above my head, but maybe that's why I like it
Some of the topics the author discusses are above my knowledge/skill level, but that doesn't make them bad ideas. Read more
Published 1 month ago by Bernard Hunt
3.0 out of 5 stars OK, but not as good as Effective C++
I loved the Effective C++ book and bought this because it is part of the same franchise. The tips inside are interesting and useful, especially if you are an experienced programmer... Read more
Published 1 month ago by Ch3w33
5.0 out of 5 stars Fantastic
I have written C# for years now, and this book covers all the important ways to write much better C# code. Read more
Published 2 months ago by Anupam Banerji
5.0 out of 5 stars Great for advancing C# programmers
I really like the content of this book, it digs deep in some areas not generally covered by website searching or basic C# books. Read more
Published 2 months ago by Jeremy Morgan
5.0 out of 5 stars Excellent Book
Highly recommended. The topics are concise that come with solid examples. Already learned a lot from this book and I'm only a 1/3rd of the way through the book. Read more
Published 4 months ago by Andrew
4.0 out of 5 stars Worthwhile C# Reference, IMHO
First, of all, I read a lot of code... co-workers, Code Project, Open Source, blogs, books, etc. Books like this are a significant cut above the average source code uploaded to... Read more
Published 4 months ago by D. Suilmann
4.0 out of 5 stars Very useful addition to a programmer's bookshelf
My copy of Effective C++ by Scott Meyers (1998) is well worn, even though I had many good C++ books when I bought that copy. Read more
Published 5 months ago by dotsnail
4.0 out of 5 stars Worth Reading !
have been a professional software developer for almost 30 years and a C# developer for almost 10.

Like most developers starting out with a new programming language, you... Read more
Published 6 months ago by Glenn Witerski
4.0 out of 5 stars Exactly what the title says
Definitely not a book for beginners but quite an interesting one for medium to expert level programmers. For sure it is one of those that make you a better coder.
Published 6 months ago by Tomasz Kajetan Stanczak
Search Customer Reviews
Only search this product's reviews

What Other Items Do Customers Buy After Viewing This Item?


Forums

There are no discussions about this product yet.
Be the first to discuss this product with the community.
Start a new discussion
Topic:
First post:
Prompts for sign-in
 



So You'd Like to...


Create a guide


Look for Similar Items by Category