Basically, this 'question' is intended to pool information about best practices in the community. The reasons for this are:
- The distinct lack of an community based ASP.NET MVC resource for best practices. Yes, I am aware of wiki.asp.net.
- I'm painfully aware that the ASP.NET wiki on ASP.NET MVC is woefully small and terribly out of date and needs fleshing out more by Microsoft before the community does anything with it.
- I'm very much interested in best practices in general, having had a fair degree of experience with ASP.NET MVC over the last year, but I'm also mindful that I'm no expert, and that I can definitely improve. This post, I believe, can help that, and you.
I gave some serious thought on whether or not I should ask this question, even going to the lengths of creating a question on meta about creating this question. :)
What I am looking for is for best practice information on all aspects of ASP.NET MVC. Controllers, models, extensions, HTML helpers, route builders, TDD.
In the past, I have found resources, such as Kazi Manzur Rashid's best practices (part 1 and 2) post quite useful, along with Maarten Balliauw's weigh-in, but these have dried up somewhat, and I was hoping for a more dynamic and growing repository of information from different people, rather than just the occasional blog entry from learned individuals. Information like this is few and far between, and ASP.NET MVC community resources even less so.
MVC in general
Model
Feel free to add model links
Views
Controller
Feel free to add controller links
Guidelines:
- One "best practice" per answer
- Take the time to explain why it should be preferred over the alternatives.
- Read existing answers first - if you see one you agree with, up-vote it; if you disagree, down-vote and leave a comment explaining why.
- Feel free to edit any answer if you can expand on why it is "best"!
P.S. Please don't just put "Anything by Phil Haack, Scott Guthrie, Rob Conery or Scott Hanselman"!