Bring back incremental C# compilation
When coding Java in Eclipse, the compiler incrementally compiles the project in the background every time a file is saved. This way, when the user clicks run, the launch is instantaneous, rather than the long build process that comes with C#. This makes it easier to develop and test small changes, which in turn makes it easier to find and fix bugs.
The C# compiler originally had this functionality, but it was removed when .NET 2.0 arrived as it could sometimes cause problems. However, given that it been proved possible in an equivalent language by the Eclipse team, coupled with the obvious advantages a robust implementation of such a feature would bring, makes it an ideal candidate to be reintroduced.
In recent years the C# team has not shied away from difficult and advanced features, so I am confident they could achieve this, and it should provide a big improvement to developer productivity and satisfaction, and make C# more competitive with scripting languages for rapid, iterative development.
David Schwartz commented
Hey Jon, it is indeed annoying how long it takes to go from making the change to running the app and seeing the results. In fact, it seems like this was once much faster. But when I thought about it, it occurred to me that the problem was the complex dependency tree in large applications. One (of our many) website projects has a total of 48 projects in the solution, and most of those projects are close to the top of the dependency hierarchy, while most of our work is close to the bottom. For example, the DAL projects only depend on five projects, but most day-to-day work involves updating the layers to make use of a new column or table. That means that I spend most of my work at a level where every change will affect 40+ projects within the solution. I think that most (not all) build-time issues are due to problems like this. Incremental compilation means that every DAL change will cause tens of thousands of lines to be recompiled. Most saves do not result in a complete feature, meaning a whole lot of wasted CPU/IO time that would be better spent analyzing my current work and helping me identify possible mistakes (static analysis) and explore my codebase (intellisense). I think that's why incremental compilation, in the old form, doesn't exist.
George Hahn commented
The free NCrunch addin does this.
Alex Davies commented
.NET Demon does exactly this:
Costs money, but not too much
Telerik JustCode offers a background compilation capability which works quite nicely.
Jeff Winn commented
RIA services was doing something similar for intellisense purposes by automatically compiling the project on you however was removed as of version 1.2. I'd definitely avoid putting this in, for larger solutions this was a huge headache. It's fine if you're in a smaller solution without a lot of projects, but if you're in a large solution with a lot of projects depending on the project you just changed, it creates a huge hassle. Just my opinion.
Aaron Laws commented
Looks like Roslyn will fix all this.
Fabian Schmied commented
@sampai: ReSharper is a great tool and I am using it, but it does not make the launch of a project instantaneous at all - it only parses the code, it doesn't produce any binaries.
Use ReSharper. It does all you need and eventually will boost your productivity many times.
Fabian Schmied commented
Maybe the parser that currently generates the squiggly red lines for errors (this is often called "background compilation") could be extended to perform the incremental compilation.