tags:

views:

437

answers:

11

Where can I find samples of C# code written by top programmers for learning ? thanks,

+3  A: 

I would check out CodePlex.

Andrew Hare
Thanks. That was quick :)
There's a lot of code on CodePlex, but how much of it is good? ;)
Cameron MacFarland
Well, you need to choose projects carefully then...
Romain Verdier
+9  A: 

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.

Mark Rushakoff
A: 

Checkout my answer to this here

Jake Scott
+5  A: 

Scott Hanselman has a great series, "The Weekly Source Code" which are well worth a read.

Jason Sundram
+1  A: 

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.

MusiGenesis
+2  A: 

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.

Brian Rasmussen
+2  A: 

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?

What are the best C# .NET books?

A good C# book

Best C# Book For An Experienced Programmer

rick schott
You could have atleast mentioned a single 'decent' C# book.
Matthew Scharley
Finding the "decent" one when you don't know what to look out for can be a minefield. Crap books outweigh decent ones by at least 2:1
spender
Search this site, you will find plenty
rick schott
Earned yourself a +1 :)
spender
+1  A: 

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.

John K
A: 

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.

RossFabricant
+2  A: 

You can have a look at the Mono project source code.

Romain Verdier
A: 

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

ChrisFletcher