Good Programming Practices
A guide to your “code”
best practices for Good programming
Avoid having too large files.
Avoid writing very long methods.
Use Early Binding for Better performance
Method name should tell what it does.
A method should do only 'one job'.
Pay Attention to Initialization Order
Do not hardcode numbers.
Avoid using many member variables.
Use enum wherever required.
Do not make the member variables public or protected.
Never hardcode a path or drive name in code.
"self check" when the application startsup.
Error messages should help the user to solve the problem.
Avoid commenting every line of code.
Disable Session State when not in use
Choose your Session State provider carefully
Usage of ViewState
Avoid excessive round trips to the server
Use Page.IsPostback to avoid extra work on a round trip
Reuse work by Caching
Remove code from content as much as possible
New Page Directives
Use Response.Write for String concatenation
Do not forget to disable Debug mode
Use server controls only when appropriate
Use the WEB.CONFIG/Machine.Config FILE to store application wide data
Exception handling in ASP.Net
Good Programming Practices - EBook