Thursday, December 22, 2011

.NET Development Tips & Tricks


There are a multitude of tips and tricks .NET developers should know. This post covers a small subset of available tools that give you great bang for your buck. 

Here are some of my favorite tools:

Nuget: Allows you to add references to and streamline maintenance of many open source projects (including log4net, Castle, Microsoft Entity Framework, OpenXML, Spring.net, etc). You can also host your own Nuget gallery.

Reflector: "Browse, analyze, decompile and debug .NET code" - No longer free, but I'm sure it's still at least as awesome as it was. This is particularly helpful in illustrating why you should obfuscate your intellectual property.

Code Translator: If you've got a snippet of VB from a web site and you'd like it translated to C# or vice versa, this is an easy to use tool that will do the trick most of the time.

Visual Studio Extensions:
Power Commands: Collapse Projects, Open Command Prompt, Undo Close, Copy References, Paste References, Extract Constant

Productivity Power Tools:  Pinned tabs , Color tabs according to their project or according to regular expressions

Slow Cheetah: "This package allows you to automatically transform your app.config (or any file) when you press F5 in Visual Studio. You can have different transformations based on the build configuration. This will enable you to easily have different app settings, connection strings, etc for Debug versus Release. If you want to transform other files you can do that too." - It's really well done.

Hints for team development:

  1. Whenever possible, start with a Virtual Machine that has your database and other configuration chores already done. While you may pay a slight performance price for running your development environment in a VM, the time you are potentially saving in configuration nightmares is well worth it. The cost of configuration troubleshooting is almost certainly higher your team is remote.
  2. Comment your checkins! While comments on checkins should not be excessively verbose, if someone has just gotten latest and the project no longer builds, some hints about what changed will be appreciated.
  1. Check in everything when possible. If you have pending changes for other projects that you are not going to be working on in the same day, shelve them! Keep life simple, why waste time thinking about what things you can check in and what things you can't?

    Also, if you can't check something in due to configuration differences between your environment and other devs on your team, resolve the differences! It's worth it. A tool that may be very helpful is SQL Server's aliasing functionality.
  2. Be available. During normal work hours, you should be on IM or group chat as much as possible.
  1. For files that don't  handle merge conflicts well, ie edmx files, communicate when you would like to make changes and make sure that you're the only one making changes. This can save significant rework. 

No comments:

Post a Comment