One thing that makes HTML easy to learn is the abundance of examples. You can go to any old website and view the source to see how it’s put together, or look through templates on a site like Open Source Web Design or Open Source Templates. It’s easy find examples of good (and bad) practice.
Scott Hanselman’s article Reading to Be a Better Developer got me wondering why we don’t do this more with .NET code, and the problem for me seems to be finding good code examples. Scott recommends looking at the Coding4Fun Developer Kit, but I wanted something more specific to web development.
So here are a few places I found ASP.NET source code that’s worth studying and learning from.
Microsoft Enterprise Library
A great place to start is the application blocks in Microsoft’s Enterprise Library. These are application service components designed to follow Microsoft best practices and include modules for caching, cryptography, data access, exception handling, logging, policy injection, security and validation.
Website Starter Kits
Another good place to look is the ASP.NET Starter Kit Websites, a collection of working ASP.NET demos that can be examined or built on. They cover DotNetNuke, e-commerce with PayPal, blogging, project time management, media library and plenty more.
Codeplex
Lastly Codeplex, Microsoft’s open source project hosting site. There’s so much goodness here it’s hard know where to start, so try browsing the most popular or active projects to start. Here are the top ten that caught my eye:
- BlogEngine.NET
Full featured blog engine targeted at .NET developers. It is light weight and very simple to modify and extend. - Umbraco
Simple, flexible and friendly ASP.NET CMS - DinnerNow
Sample marketplace application designed to demonstrate how you can develop a connected application using IIS7, ASP.NET Ajax Extensions, Linq, WCF, WF, WPF, Powershell, and the .NET Compact Framework. - Community Kit for SharePoint
Set of best practices, templates, Web Parts, tools, and source code for creating a community website based on SharePoint.
- Facebook Developer Toolkit and Facebook.NET
.NET wrappers and libraries for the Facebook API. - DbEntry.Net
Lightweight, high performance Object Relational Mapping (ORM) database access compnent for .NET 2.0. - PublicDomain
.NET packages for time zone support, logging, dynamic code evaluation, GAC API, unzipping, RSS, Atom, OPML, screen scraping, and utilities for strings, arrays and cryptography. - ASP.NET RSS Toolkit
Gives ASP.NET applications the ability to consume and publish to RSS feeds. - NGenerics
Class library providing generic data structures and algorithms not implemented in the standard .NET framework - Html Agility Pack
Agile HTML parser that builds a read/write DOM and supports plain XPath or XSLT. The parser is very tolerant with “real world” malformed HTML. The object model is very similar to System.Xml, but for HTML documents.
If you know any other places to find good quality .NET source code then please leave a comment.
August 28, 2007 at 10:45 am
Umbraco is one of my least favortites. At first I was excited to get into using the system, but then i got into the code and the interface of it. Was hardly usable, the interface was okay — if you’re a developer but trying to get a regular secrtary to author content would be IMPOSSIBLE, and clicking on the “Help” link always brought to you a page called “woops, something happened”. Not very intuitive. So, i tried full source updates and was exposed to nothing but bugs and over 4000 warnings. Not my idea of a decent CMS.
August 29, 2007 at 2:26 am
Why not these…
1. DotNetNuke [http://www.dotnetnuke.com/]
2. Rainbow [http://www.RainbowPortal.net]
3. NxBRE [www.agilepartner.net/oss/nxbre/]
These are the things I regularly use and found it quite useful…
August 29, 2007 at 11:04 am
Don’t forget Community Server
August 30, 2007 at 3:24 am
Chad-
As far as I know Community Server source isn’t available unless you purchase it from the guys over at Telligent.
September 2, 2007 at 4:00 am
Ryan:
It’s available for free, just download the SDK. However, you won’t be able to run a production site without licence.
September 3, 2007 at 6:48 am
[...] I like the idea of reading other people’s code to learn more about programming. This post lists several resources for code samples. [...]
September 20, 2007 at 11:01 pm
Not sure so about using the DNN codebase as a study guide…
September 29, 2007 at 5:03 am
Andreas:
The SDK doesn’t give you access to the source. Just a way to tie into the application programatically.
February 22, 2008 at 10:30 pm
[...] Reading other people’s .NET code « Fun with .NET and SQL Server (tags: asp.net) [...]
March 5, 2008 at 6:00 am
We have found a lot of the info on this site very helpful. Thanks for sharing it! Also — since we signed up with Server Intellect – the new Windows Server 2008 includes many upgrades and additions — like to new web, security and virtualization technologies – all of which are really helpful to our developers.