tags:

views:

924

answers:

8

When we talk about the .NET world the CLR is what everything we do depends on. What is the minimum knowledge of CLR a .NET programmer must have to be a good programmer? Can you give me one/many you think is/are the most important subjects: GC?, AppDomain?, Threads?, Processes?, Assemblies/Fusion?

I will very much appreciate if you post a links to articles, blogs, books or other on the topic where more information could be found.

Update: I noticed from some of comments that my question was not clear to some. When I say CLR I don't mean .Net Framework. It is NOT about memorizing .NET libraries, it is rather to understand how does the execution environment (in which those libraries live on runtime) work.

My question was directly inspired by John Robbins the author of "Debugging Applications for Microsoft® .NET" book (which I recommend) and colleague of here cited Jeffrey Richter at Wintellect. In one of introductory chapters he is saying that "...any .NET programmer should know what is probing and how assemblies are loaded into runtime". Do you think there are other such things?

Last Update: After having read first 5 chapters of "CLR via C#" I must say to anyone reading this. If you haven't allready, read this book!

+4  A: 

Updated: reading the relevant parts of the book CLR via C# by Jeffrey Richter..this book can be a good reference..

Gulzar
I haven't even heard of that book, yet I've done plenty of work with the CLR and can tell you all about appdomains/assemblies/etc/etc. Am I somehow less qualified for not having read a particluar single book?
Orion Edwards
i did not mean that way. i read it pretty late too. just that it is a good consolidated place for lots of clr related stuff. will edit my post.
Gulzar
agreed.. different people have different paths to attain knowledge.
Gulzar
+21  A: 

Most of those are way deeper than the kind of thing many developers fall down on in my experience. Most misunderstood (and important) aspects in my experience:

  • Value types vs reference types
  • Variables vs objects
  • Pass by ref vs pass by value
  • Delegates and events
  • Distinguishing between language, runtime and framework
  • Boxing
  • Garbage collection

On the "variables vs objects" front, here are three statements about the code

string x = "hello";
  • (Very bad) x is a string with 5 letters
  • (Slightly better) x is a reference to a string with 5 letters
  • (Correct) The value of x is a reference to a string with 5 letters

Obviously the first two are okay in "casual" conversation, but only if everyone involved understands the real situation.

Jon Skeet
plus Exception handling and garbage collection
Filip
Boxing? Do .Net developers really get picked on that much? :)
EBGreen
Exception handling is more a case of good design than fundamental understanding of what exceptions do, in my experience. But yes, I'll add GC to the list.
Jon Skeet
Boxing - yup - us microserf$ get picked on a lot
seanb
+1 for exception management, because I've been surprised how many developers don't understand how two-pass model.
RoadWarrior
I wouldn't say you need to know this stuff to be a _good_ .Net programmer. I'd say this is stuff you need to be a PASSABLE .Net programmer. Seriously, wtf?
TraumaPony
for entry level that's a fine place to start. Even if you don't know those things a willingness and desire to learn is a bonus.
Sara Chipps
@TraumaPony: You'd be amazed at the number of people I've interviewed who don't "get" this stuff.
Jon Skeet
@Jon Skeet: Bah, I hope you didn't hire any of them :P
TraumaPony
@Jon Skeet: Thanks for the answer, alldough I voted it up there is 1 thing I don't understand: What do you mean by "Variables vs objects"?
enba: People often talk about an "object named x" when they mean "the object that variable x's value refers to". That kind of shorthand is okay so long as it isn't due to a real misunderstanding. You need to understand that the value of a variable is never an object itself. Some people don't :(
Jon Skeet
@Jon: do you mean that variables are secretly pointers^H^H^H^H^H^H^H that "P" word ?
Jimmy
Editing for clarity...
Jon Skeet
ok, now I see. What is the difference between "X is a reference" and "the value of X is a reference"?
Jimmy
or I guess, what is the distinction between "x and y are references to the same something" and "x and y have identical values, which is a reference to something"
Jimmy
A: 

Jon's answer is good. Those are all fairly basic but important areas that a lot of developers do not have a good understanding of. I think knowing the difference between value and reference types ties in to a basic understanding of how the GC in .NET behaves, but, more importantly, a good understanding of the Dispose pattern is important.

The rest of the areas you mention are either very deep knowledge about the CLR itself or more advanced concepts that aren't widely used (yet). [.NET 4.0 will start to change some of that with the introduction of the parallel extensions and MEF.]

Scott Dorman
Agree that understanding IDisposable is important. No upvote though because its a framework and language concept. The CLR knows nothing about it..
Paul Batum
The CLR absolutely knows about IDisposable since it is integral to the memory management processing done by the CLR.
Scott Dorman
A: 

The minimum is... you deliver what you have been asked for within agreed time slot...

But real answer is that you must memorize minimum half of the .Net Framework 2.0 and quoter of 3.0. Otherwise you are bad .NET programmer.

Did it help?

Greets Mariusz

aristo
You don't need to memorize, you need to understand what is available to you. There is a big difference. Delivering on time does not neccessarily make you a good programmer, delivering correctly and with high quality makes you a good programmer, which you can't do without understanding your tools.
Scott Dorman
One up-vote from me on this post, aristo is quite right. The question was arguably wrong, it should have omitted "of CLR". Only quibble: you don't need to memorize half, just 20% and knowing how to find the rest back in the MSDN library.
Hans Passant
The question is asking what it wants to ask, and I think it's perfectly reasonable. There are important aspects of the CLR which you need to know. Yes, you need to know areas of the framework too, but that's not what this question is about.
Jon Skeet
you didn't get me guys at all. The question was of the type: how many books do I have to read to be good programmer. So I answer. 27.54 books. This place ends up with this kind of questions unfortunately. Real technical questions are not very popular here...
aristo
I think the question was asking about what areas of the CLR are important to have a more than passing familiarity with in order to be a good programmer. While "good" is subjective, the fact remains that the chance a programmer with that knowledge will be better than one without is higher.
Scott Dorman
oh, I just noticed this little discussion on my question so I can explain what I meant. The question was not whether one has to memorize Framework. Title is very specific and it refers to CLR. I believe that a good programmer MUST know much deeper many aspects of it to even consider himself one.
+1  A: 

Should know about Memory Management, Delegates

K Man
+1  A: 

Jon's answer seems to be pretty complete to me (plus delegates) but I think what fundamentally seperates a good programmer from an average one is answering the why questions rather than the how. It's great to know how garbage collections works and how value types and reference types work, but it's a whole other level to understand when to use a value type vs. reference type. It's the difference between speaking in a language vs. giving a speech in a language (it's all about how we apply the knowledge we have and how we arrive at those decisions).

Knowing why is important, but until you understand how a thing works you can't reliably answer why you should (or shouldn't) use it under given conditions.
Scott Dorman
Agreed... I was just commenting that how something is done vs. the why really seperates the difference between an average developer and a great developer
A: 

One thing that can be really tricky to grasp is deferred execution and the likes.

How do you explain how a method that returns an IEnumerable works? What does a delegate really do? things like that.

Erik van Brakel
+1  A: 

A great programmer cannot be measured by the quantity of things he knows about the CLR. Sure it's a nice beginning, but he must also know OOP/D/A and a lot of other things like Design Patterns, Best Practices, O/RM concepts etc.

Fact is I'd say a "great .Net programmer" doesn't necessary need to know much about the CLR at all as long as he has great knowledge about general programming theory and concepts...

I would rather hire a "great Java developer" with great general knowledge and experience in Java for a .Net job then a "master" in .Net that have little experience and thinks O/RM is a stock ticker and stored procedures are a great way to "abstract away the database"...

I've seen professional teachers in .Net completely fail in doing really simple things without breaking their backs due to lack of "general knowledge" while they at the same time "know everything" there is to know about .Net and the CLR...

Thomas Hansen