ŷ

Jump to ratings and reviews
Rate this book

CLR via C#

Rate this book
Dig deep and master the intricacies of the common language runtime (CLR) and the .NET Framework 4.0. Written by a highly regarded programming expert and consultant to the Microsoft® .NET team, this guide is ideal for developers building any kind of application-including Microsoft® ASP.NET, Windows® Forms, Microsoft® SQL Server®, Web services, and console applications. You'll get hands-on instruction and extensive C# code samples to help you tackle the tough topics and develop high-performance applications.

898 pages, Paperback

First published July 12, 2006

264 people are currently reading
1,180 people want to read

About the author

Jeffrey Richter

27books32followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
739 (67%)
4 stars
265 (24%)
3 stars
73 (6%)
2 stars
16 (1%)
1 star
5 (<1%)
Displaying 1 - 30 of 67 reviews
Profile Image for Ant.
125 reviews8 followers
February 17, 2013
Finally! I finished this tome. It only took me the best part of a year to wade through its 900 pages but I'm glad I did. This was the third edition of the first I'd read many years ago & assumed most of it would be rehashed verbatim with the new stuff "inserted here" but I was wrong. It was a fresh rewrite of the entire CLR explained. And better than the original. As with the first edition it starts dauntingly in the deep end of assemblies, assembly linking, Satellite assemblies, the relationships between native Code & IL & the CLR, quite low level. Then it gets onto the interesting daily bread stuff of Primitive & Reference types & all they encompass, including great discussions on generics & the newer 4.0 delegate types.
He puts a lot of time into talking about strings and very good chapters on delegates and IDiposable and the garbage collection life cycle, as well as quite a lot on Custom Attributes. In short, he writes about everything to a greater or lesser extent in this book. There is a group of chapters dedicated to threading & synchronous constructs which as he himself states, is a book in itself. I was losing it by this stage & skimming a lot of it, however there is a lot of good reference material in this section, including discussions of the new 4.0 parallel class & its use with LINQ. (LINQ itself was not discussed in the book, being a language, and hence not part of the CLR)
His style is fun, relaxed, excited & inspiring. You can tell he's still completely turned on by the CLR, he loves it but retains room for its criticism where he sees fit (which is rare, but justifiably scathing at times). He often talks about something as though he were unwrapping an anticipated Christmas gift, such is his enthusiasm. And his enthusiasm is contagious as you wish and dream the project you are working on was targeting 4.0 so that you could 'Task up' a thread instead of using the old Threadpool work horse.

I can't deny, it is the best .NET book I have ever read. Best for reference, best for writing style & clarity. I am also glad that Richter is not going to write another one because I would probably read it, & I just don't think I'd get through another 900+ pages again!
The book is a staple for the .NET framework. Read it.
Profile Image for Rene Stein.
224 reviews37 followers
February 10, 2014
I o poslední edici se dá napsat jen to, že kdyby všichni vývojáři v C#/.Net Frameworku, se kterými se potkáváte, znali alespoň 25 % toho, co je v této knize, svět by byl mnohem lepším místem k životu a vývoj SW by nepřipomínal závody v dovednostech "kdo dokáže vytvořit nejvíce blokovaných a neužitečných threadů v aplikaci", "kdo nejrychleji zablokuje pomocí nevhodného volání Wait metod zbytek aplikace", "kolik mutexů/locků se dá nacpat do jedné metody, než dojde k deadlocku na nečekaném místě v aplikaci" a přišli bychom i o královskou disciplínu, v níž se týmoví hráči rozřazují podle odpracovaných let tak, aby proběhla spravedlivá "volba trotla juniora, který stráví na každém projektu nejvíc času duplikací konstrukcí a metod, které již v .Net Frameworku/WIN32 API jsou a které nezvládl vygooglovat, a volba trotla seniora, který o existenci některých služeb i metod ví, ale raději si napíše všechno sám, protože kódu v NF nevěří a ty jeho přerostlým egem a iracionální volbou osudově poznamenané třídy přeci budou několikanásobně rychlejší".

Nové vydání se zabývá i TPL a klíčovými slovy async/await a tyto kapitoly patří mezi to nejlepší, co jsem o těchto tématech doposud četl. Navíc je J. Richter autorem pěkné knihovny Power Threading Library (), která byla inspirací i pro některé novější konstrukce v NF.


Stejně jako u předchozích edic knihy bych kritizoval jen drobnosti:

1) Jeffrey Richter podle mě občas přehání snahy o optimalizaci kódu . Jsem dalek toho, abych opakoval špatně chápanou mantru, že "optimalizace je kořenem všeho zla", ale u některých stránek jsem měl chuť zařvat "vybral sis pro řešení problému špatnou platformu, nebo už jen před modelovým čtenářem řádně exhibuješ". Pak jsem si ale uvědomil, že v noci se řvát nemá a že na exhibici není nic špatného, jestliže ji provádí někdo, z něhož nečiší neznalost, neodbornost ani prostá hloupost. A neznalost, neodbornost ani hloupost opravdu nejsou dary, kterými by byl J. Richter obdařen a které by přenášel na čtenáře.

2) Jestliže je J. Richter tak posedlý optimalizací, měl by zmínit i další významné a u některých typů aplikacích silně se projevující nedostatky některých konstrukcí. Například při výkladu "condition variable" u threadů nezazní, že metody Monitor.Pulse a Monitor.Wait, které se v NF používají jako ekvivalent konstrukce "condition_variable", mohou přinést problémy s vícenásobným "context switchem", protože vlákno, které volalo Wait, může být po "Pulse" signalizaci z jiného vlákna probuzeno dříve, než je zpět získán "lock".

Na knize mě potěšilo také to, že WinRT spravedlivě popisuje jen na tolika stránkách, kolik jich odpovídá rozšíření i kvalitě Windows "Modern UI" aplikací. :)
Profile Image for Jeff Dalton.
82 reviews3 followers
March 23, 2014
I read the first edition of this book about 10 years ago. I wanted to re-read to see what has changed since that time. I already knew ~90 % of what the book covered, but that extra 10% was eye opening. Most of it dealt with the way threading and writing asynchronous code. Understanding how CLR handles threads and memory made me realize the F# compiler camp is spread some false stories about the immutability of their language. I imagine Scala is the same way depending on which JVM it uses for runtime.

I gave it a three stars because I found myself really board at times. Granted this is a hard subject to make lively and entertaining, but GD some of the sections were like chewing on a wet napkin.

If you are a .Net developer and you are serious about your craft then this book is a must read. Especially the last section on Threading. I'm only sad the the people that wrote SharePoint didn't take some of the authors advice. If they had I might not have so many grey hairs. :)
Profile Image for Bartłomiej Falkowski.
229 reviews26 followers
May 20, 2021
What a work! I first used C# about 15 years ago. I didn't expect that reading a book from 2012 (last edition) about CLR could give so much enjoyment.

What I liked:
- It's not just an another position about C#. It contains vast and profound knowledge. I would rather describe it as "how to write an effective code using tools like C# and CLR".
- Great explanation of managed heap and GC details.
- Really dense knowledge about threads - 4 chapters dedicated them. I especially appreciated the emphasis of efficiency and reducing the number of threads in use.
- Hidden instructions of good programming. Even though Table of Contents doesn't contain any chapter named "Good programming principles" we can find a lot of them scatterd over various paragraphs.
- I felt like it's more than just a book. It seems to me that author left his legacy in this work. We have many places where he shows multiple paths of potential evolving of C# or CLR. We also have many places where he decides to criticize the Microsoft for particular design decisions. In the end it's not only about facts. It's also about author subjective opinions and recommendations which eventually give invaluable and inimitable style and value.

What I didn't like:
- Chapter about WinRT from 2021 perspective :) I ommited it.
- No newer edition that 4th from 2012 :(

To sum it up - it's the best book from Microsoft / C# / .NET environment I've ever read. I highly recommend!
223 reviews6 followers
November 2, 2014
Let me start by saying this:

Every chapter is a 'world in itself'.

That is the amount of detail you gain from each chapter. The chapter names might sound simple and naive, but the author takes you on a deep-dive on that topic.

I started with the 3rd edition and finished with the 4th one and I regret not having read this book a little early in my career. IMHO if you have at least 3 yrs of experience in .net/C#, this book can bolster your understanding by leaps and bounds. Beginners (6 mos to 1 yr of exp) might not appreciate very much.

Doubtless that I have read many tech-books being a software professional, but this one is the best one so far.

The chapters 5 - Primitive, Reference and Value Types and 21 - The Managed Heap and Garbage Collection are my take-away's from this book. I haven't seen another book/article that explain the topics in these chapters as clearly as the author does.
120 reviews7 followers
Want to read
November 26, 2012
If you try to make a living as a c# developer, you should know this book by heart.
Profile Image for Dmitry.
184 reviews8 followers
May 21, 2021
шарпистская библия. что еще сказать. Конечно, главы про appDomain и маршалинг начинают устаревать, но большая часть информации актуальна и сейчас
Profile Image for Moved to.
5 reviews5 followers
March 29, 2014
Don't read this book. It's unprofessional, full of author's opinions, instead of focusing on actual facts about CLR and C#. Also the author himself writes that he doesn't like Microsoft's guidelines and doesn't follow them. This is a bad practice and will teach you to code wrongly.

Here are some quotes from the book that really frustrated me:

The C# language specification states, “As a matter of style, use of the keyword is favored over use of the complete system type name.� I disagree with the language specification; I prefer to use the FCL type names and completely avoid the primitive type names. In fact, I wish that compilers didn’t even offer the primitive type names and forced developers to use the FCL type names instead.
- author here promotes the usage of Int32 instead of int, Int64 instead of long, etc.

Another one:

Personally, I don’t like properties and I wish that they were not supported in the Microsoft .NET Framework and its programming languages.


And another one:

Fun observation: when I tested this code on my machine, the CPU usage on my 8-processor machine went all the way up to 100 percent, of course. Because all the CPUs were busy, the machine got hotter and the fan got a lot louder!
After processing completed, the CPU usage went down and the fan got quieter. Fan volume is a new way of verifying that
everything is working as it should.

Profile Image for Isen.
253 reviews5 followers
December 7, 2017
CLR via C# cover a broad array of topics on C# and the Common Language Runtime, and there is certainly a lot of value to be had from this book. However it is not clear to me how this book is to be read. I kept it on my desk and snuck in a few pages in between tests running and code compiling, and this is certainly not the right way to read this -- it's a bit dense; there are code examples in both C# and IL and in many cases you really need to work along the book with your own code to get the most out of it. Despite the subtitle, it's not really a reference book either. The chapters are designed to be read from start to finish, and they're a bit long. It would be difficult to quickly refresh yourself on a particular topic unless you know exactly what you're looking for. Nor does the book work as a textbook, as there are no questions/exercises, and the chapters have a lot of forward and back references, but deal with disparate subjects and don't really build towards any conclusion. It would probably be best suited to a freelance programmer who can dedicate an hour or two a day to actively work through it, in which case it would be very valuable indeed. As is, I think I only took away about 20% of what the book had to offer.
Profile Image for Cyril.
1 review
August 9, 2012
This book is a definite must-read for whoever is involved with .NET development for a living or hobby projects.
In 29 chapters divided in 5 parts, the .NET topics coverage is extensive and full of hard-to-find-elsewhere insights on important design rationales that led Microsoft to design and implement .NET as we know it today. Besides a thorough presentation of everything there is to know about .NET itself, in the context of C# programming, Jeffrey also discusses the numerous Design and implementation tradeoffs that every seasoned .NET programmer MUST be familiar with before making decisions about his/her own code.
Unsurprisingly, the (multi) threading chapters come last and are among the most complete one can possibly find ever published, re: .NET (it's one of Jeffrey's favorite topic).
The only area that may leave some readers a bit hungry still is re: the Reflection.Emit / IL generation in general. Writers of compilers targetting CIL will have to back up to some other specialized books or MS developers blogs, like Mike Stall's, etc.

Still: a must on your .NET bookshelf.
Profile Image for Myte.
16 reviews
September 8, 2022
This book is a real bible for .NET developer. If you want be a good .NET engineer - this book must be in your read list. It covers how .NET platform is build under hood and how works you chosen language.

One of good things about this book - each time you will read it with a new level of experience - each time you would found something new. My first time was long days ago in 2014, but I returning to this book over time again and again
17 reviews1 follower
June 21, 2015
Ever wonder what all that syntactic sugar is doing to your C# code's metabolism? If you use .NET and you're concerned with "best practices" (and if you're not, you really should be), this is a must read. Jeffrey Richter writes with enthusiasm and clarity, and digs beneath the skin of what is covered in a standard C#/.NET manual. (Not for .NET beginners.)
Profile Image for Tushar Tyagi.
44 reviews7 followers
April 15, 2018
Such an amazing book!
I've not read the entire thing; but I keep going back to it for having the deep understanding of whatever I am working on at the moment and it has never disappointed me. The language is terse, the presentation clear, and the depth and the breadth covered is just mind blowing.
Really deserve more than 5 stars.
Profile Image for Ivo Stoykov.
231 reviews17 followers
Read
September 2, 2013
A highly must read book for c# developers. A valuable insight on various aspect of developing c# applications. Jeffrey Richter offers in-depth research and clear explanations of CLR. This book has the potential to extend the knowledge even to experienced professionals. Highly recommended.
Profile Image for Szántó Balázs.
7 reviews
December 25, 2014
This book is a must read, if you're heading into writing C# code. Not only deep dives it into the .NET internals, but the way it's presented by Jeffery Richter is really easy to understand. After reading it, you'll think different.
Profile Image for Andrey.
2 reviews1 follower
Read
May 15, 2012
The fundamental book to know how C# really works. Not for beginners.
Profile Image for Daniel.
17 reviews2 followers
June 16, 2013
Is a good book, if you want to STUDY the basis of CLR.
It´s not so good to use as pocket book when you are in doubt of something.
Some chapters are not very clear.

Profile Image for Mark.
44 reviews
May 29, 2013
This is the 4th edition of a book that started me off in .NET 5 years ago with the 2nd edition. It is a classic. I'm going back through the 4th edition now, slowly. Highly recommended.
Profile Image for Tugberk Ugurlu.
Author1 book15 followers
October 12, 2014
you're not a C# dev till you read this book. It's amazing how well-structured the samples are. Highly recommended.
Profile Image for Pavel Shchegolevatykh.
51 reviews3 followers
March 16, 2019
One of the classic boring technical books with raw information. Nothing special. Even Microsoft documentation is much better now.
Profile Image for Hayk Karapetyan.
3 reviews
April 6, 2019
One of the must-read books if you want to professionally develop software under the .NET Framework.
Profile Image for Ivan.
43 reviews16 followers
June 14, 2024
Still good in 2024, however, not without its flaws that are not due to being dated.

One example of strong opinions that are just plain wrong while discussing ReaderWriterLockSlim and how EnterUpgradeableReadLock is useless feature.

"Here’s why: A thread can’t just turn itself from a reader into a writer.
Other threads may be reading, too, and these threads will have to exit
the lock completely before the thread trying to upgrade is allowed to
become a writer. This is the same as having the reader thread exit the
lock and then immediately acquire it for writing."

It's not the same because of the atomicity guarantees of upgrading the lock to a WriterLock. If we just exited a ReaderLock and reacquired a WriterLock, another WriterLock may have snuck in and changed the state we wanted to change prior to upgrading. So we have to check again for the state.
1 review
November 2, 2017
must read book for every .net developer. initial 3 chapters revolve around concepts like assemblies, bundling and packaging and few other but after that it pick full pace and focused on core concepts with lot of code samples. Chapters like CLR hosting, App domain, Threading are just awesome.
22 reviews
Read
November 8, 2020
This book is really detailed and intricate.
Jefferey along with presenting the idea, usage and implications of CLR features mentions the supplemental tools. This is enriched with his own coding extensions.
This book is what you read to be a know it all for .NET development.
3 reviews
October 9, 2019
Глава про многопоточку слишком поверхностная, по этой теме лучше смотреть Джозефа Албахари. В остальном книга идеальна для подготовки на собесы для джунов.
Displaying 1 - 30 of 67 reviews

Can't find what you're looking for?

Get help and learn more about the design.