Where can I find samples of C# code written by top programmers for learning ? thanks,
There's a collection of Jon Skeet's C# and .NET articles and links online, and you can't go wrong with Jon Skeet's code. It's not too code-heavy, but his insights in the other aspects of C# are invaluable - especially if you are really interested in really learning the language, not just learning the syntax.
Scott Hanselman has a great series, "The Weekly Source Code" which are well worth a read.
CodeProject has a lot of useful samples, and they're very good as learning tools because they're often not very complete or full-featured, so you still have to do some thinking and working to get them to do what you want them to do.
In addition to the many suggestions on source code, I would also recommend the book Framework Design Guidelines as it has numerous useful dos and don'ts, which I find very helpful. There's also a section on MSDN with some of the same topics.
Any decent C# book is written by a top programmer and it usually comes with code samples.
EDIT: For you guys that won't use the search feature(all links are in stackoverflow). These are just a few, takes some time and read people's responses.
C# book for the casual, beginner, C# programmer?
Half the battle of creating good quality code in any language is using it smartly. Software design patterns and practices like those published by Microsoft go a long way toward that. There are many books on the subject too.
The MSDN documentation itself is chock full of code samples freely available from Microsoft, direct from the makers of C#/.NET. There's a good chance of finding a lot of quality code from the software company itself, even if contained in simple examples. There are countless samples for everything and always little things no matter how much you know. Knowing the nuances of C# topics goes a long way too.
Also use insights gained from across a variety of books. Not every book contains everything, so expand your ability to make good coding decisions by knowing a lot from other people's experiences.
Rub elbows with a variety of programmers at user groups or even in courses, those outside the familiar culture of your workplace.
Start an open-source project or contribute to one of interest to be around more code.
Paint.NET is a great project that was originally open source. Due to abuse the author has closed the source, but an older version of the source is available through a third party.
I found the following book greatly useful when I started programming:
Code Complete: A Practical Handbook of Software Construction (Steve McConnell - Microsoft Press)
http://www.amazon.com/Code-Complete-Practical-Handbook-Construction/dp/0735619670