June 2008


It’s almost 3 weeks since I’ve started my work for new company. One thing you usually need to go through when you starting you developer’s activities at new place is new coding style, name conventions and other style rules which are different from one company to another. In last 4 years I was working in several project teams and there are always some differences in these side things I was faced to.

Another interesting thing, that in my current company we work in virtual office environment, conception that adds some new advantages, but has some features you should be ready for. In addition to slightly different communication manner, principles of creating project teams and changeable working environment you have some extra portion of mixed programming styles and subjective views on best practices from different developers and team leads.

Involuntarily you start to thinking if there any real way to produce some “common” rules for different teams. My experience says that only way when such thing happens when these rules are strongly dictated by someone. In friendly teams any attempt to do this meets personal preferences of each team member. There are some key points which we use to make some compromise:

  1. What are most teams doing already?
  2. Which option is the most readable (highly subjective)?
  3. Which option will be the easiest to maintain over time?

You can find some reasoning of this stuff here Jason Allor here.

Actually, another possible way to “generate” code style conventions is to commit this work to some tool or development environment. Surely, in this case there should be good reason to “believe” this tool – competent and authoritative source or creators of those rules. In case of C# there some work already done by Microsoft guys like Jason which can be helpful for other teams and project groups. Formerly internal Microsoft tool StyleCop, now announced as “Microsoft Source Analysis for C#” call to possibly be powerful thing to produce well-styled and maintainable code.

I was surprised with one funny stuff in VS 2008 Team Suite. When you try to get latest version by right-click on solution item in Solution Explorer it use file’s info from project files, not simply listing the TFS directories… So that if you checked out some project file for editing and then someone will add new files in this project to TFS you will never get them until project files isn’t up to date. Of cause this issue is not applicable if you have multiple checkouts switched off. So if you in the same trouble, better use Source Control View from Team Explorer pane and then include new files into the project.

There are several changes in Preview 3 we need to know about, because there is a reason why your old code don’t want to compile :)

1. The “FilterExecutingContext” (using in the OnActionExecuted method) and “FilterExecutedContext” (using in the OnActionExecuting method) are now called “ActionExecutingContext”/”ActionExecudedContext”.

2. RenderView is now only available from ComponentController class, not from Controller class.

More about Using an ActionFilter.

MVC Changes Since Preview 2