Why doesn’t the IDE do background compiling/building

compilationidevisual studio

Today I develop on a fairly complex computer, it has multiple cores, SSD drives and what not. Still, most of the time I'm programming the computer is leasurely doing nothing. When I need to compile and run/deploy a somewhat complex project at best it still takes a couple of seconds. Why? Now that we're living more and more in the "age of instant" why can't I press F5 in Visual studio and launch/deploy my application instantly?

A couple of seconds might not sound so bad but it's still cognitive friction and time that adds up, and frankly it makes programming less fun. So how could compilation be instant?

Well, People tend to edit files in different assemblies, what if Visual Studio/The IDE constantly did compilation/and building of everything that I modified anytime that it might be appropriate. Heck if they wanted to go really advanced they could do per-class compilation. The compilation might not work but then it could just silently do nothing (except adding error messages to the error window).

Surely todays computer could dedicate a core or two to this task, and if someone found it annoying it could be disabled by option. I know there's probably a thousand technical issues and some fancy shadow copying that would need to be resolved for this to be seamless and practical but it sure would make programming more seamless.

Is there any practical reason why this scenario isn't possible? Would the wear and tear of continually writing binaries be too much? Couldn't assemblies be held in memory until deployed/run?

Best Answer

Eclipse does automatic compiling and building. You might want to check out how they do it. It is open source. I think it compiles whenever you save a file.