views:

418

answers:

8

Anyone know any open source c#/asp.net projects that are well documented, use design patterns appropriately and contain the best practices? I want to read high quality code, learn from it and apply it to my job.

Thanks.

+5  A: 

In my experience, you will not learn what you want by reading code, even if it's good quality code. If nothing else, the comments in such code will more likely be about what the code is trying to accomplish, and less about how the code properly used the design pattern.

If you want to learn design patterns, then you need to look at something that intends to teach you design patterns. It's possible that there is some body of code which has this purpose in mind, and perhaps someone can point you to it. It just seems unlikely to me that a piece of code that is good at one thing will also happen to be good at teaching you design patterns and best practices.

John Saunders
+2  A: 

For me learning by reading other people's code is akin to learning to build by visiting places, or cooking by going to restaurants - it is very hard to understand the fundamentals of anything through the end result.

Otávio Décio
+2  A: 

You could check The Weekly Source Code on Scott Hanselman's blog. He regularly lists projects worth looking at.

Mathias
True, but will these projects teach him design patterns and best practices?
John Saunders
Fair enough. I actually agree with your response, regarding the specific point of patterns - a book will be better. I interpreted his "and" like an "or", in "well documented, use design patterns appropriately and contain the best practices"!
Mathias
IMHO the same applies to the best practices. They are likely to be used, without explanation. He needs the explanations!
John Saunders
+5  A: 
Darwyn
When I said, "read a book", for design patterns, I meant he should read GOF. For best practices, "Framework Design Guidelines" is the book I meant!
John Saunders
+2  A: 

I would have to say the umbraco cms. I really love their data access and presentation layer. It is a MIT license so I use it in my code. Also, the code is well commented out so beginners can pick up whats going on in the code.

Does it actually _teach_ design patterns and best practices, or does it just happen to quietly use them without explanation?
John Saunders
It does not teach design patterns but I am pretty sure any novice programmer that is interested in design patterns and have some knowledge of it can definitly figure out what is going on.
The OP said, "I want to read high quality code, learn from it and apply it to my job.". "figure out what is going on" is not what he asked for, as far as I can see. I almost downvoted your answer because of that.
John Saunders
Quote :: "Anyone know any open source c#/asp.net projects that are well documented". umbraco is open source and he can read the code that umbraco has published. correct!
+2  A: 

The best to learn is find someone in your company that is experienced and have regular code reviews. Also ask to get on his/her distribution of code reviews you may not be able to critique their work but you will get to learn about your company's "best practices" with the added benefit of understanding the internals of your own project.

If you just want general knowledge of patterns that you have not used before this site may help you out.

http://entlib.codeplex.com/

AndrewB
Thanks for the advice and link. I love the website!
burnt1ce
+2  A: 

Read books , read blogs and write code that is how you will learn design patterns and programming in general

Yassir
Many younger developers do not read. They're all random access", "interrupt driven", and "Google enabled". Sequentially reading something is foreign to them.
John Saunders
Well i'm 19, still in college in my free time i read books. I self taught ASP.Net and C# to myself reading books
Yassir
+1  A: 

Check Blog Engine and Das Blog , both are open source high quality asp.net blogs. I personally like how blog engine handles blog settings , XML&SQL Data Providers etc. Both are good read...

Also DotNetNuke is open source as far as i know but somehow i never wondered and checked that. Should be good tho , it's been out there for a long time and well known.

Tiax