The other day I was making some pretty significant changes (downgrades to 2.0, don’t ask) in a solution. I am very bad about optimizing using statements when they are not needed (this is a great refactor in CodeRush). It got me to thinking about YAGNI and how I needed to just remove those items from the templates to begin with.
I am not going into the details of how to customize item templates, just go search, but here are some of the changes I made:
- Class Item Templates
- made the class public by default. This alone is great and IMHO should be the default out of the box.
- removed all usings, except for System. This required a modification to the references section in the vstemplate also, so that the System.Xml and System.Data references aren’t added to the project.
- Interface Templates – Same as the Class template
- Class Library Project
- Removed the Class1.cs and creation. I always delete this anyways.
- Removed all references, except for System at the project level.
Although, these changes may seem small, I noticed an immediate improvement to my productivity. I then backed these up, so the next time I do a clean install they will be ready to go.