Re: Why doesn't C# allow incremental compilation like Java?
- From: Jon Skeet [C# MVP] <skeet@xxxxxxxxx>
- Date: Tue, 24 Apr 2007 17:49:02 +0100
Andy <andyj@xxxxxxxxxxxxxxxxxx> wrote:
I find it a problem - at least compared with using Eclipse in Java.
That builds every time you save, and has a sufficiently nippy
incremental compiler that it encourages you to save (and therefore
compile) often. I find this very helpful compared with the VS model,
where you can't build as often because the build takes significantly
longer. (Even if it's only 15 seconds, that's reasonably significant.)
I think you're in a minority then. Personally, I'm not compiling
after every single change I make to a single file. I work in multiple
files to get a unit of work done, and compile that. Even still, my
library assemblies don't take anywhere near 15 seconds, although my UI
assembly with lots of forms takes about that long..
I suspect I'm in the minority because most people don't practise TDD,
and most people don't realise how lovely it is not to have to wait for
a compiler.
Part of that is due to assemblies being single files (which is
brilliant in many other ways) but I suspect VS could still do a better
job at incremental compilation. It would probably have to have its own
compiler (just as VS does for Java) which makes life trickier though. I
occasionally run into problems where Eclipse's internal compiler is
pickier than the JDK or vice versa.
VS assumes you want to build the entire project. There really isn't
much of a point in building a single file; you can't do anything with
the result of that, except to link it either other modules to form the
assembly. VS 2005 doesn't suffer the problems you mention for
esclipse, because it uses the same compiler that you would outside the
IDE (MSbuild, which in turn uses csc).
Indeed - although I should stress that it's only been an issue on a
couple of occasions, and of course we run the unit tests on the JDK-
built classes as well, when we build the jar files.
Assemblies in .Net don't
contain self contained classes; usually the classes depend on each
other, and i imagine that's the case in java as well.
You've misunderstood what Eclipse does. When the save has finished, all
the classes have been compiled. However, they're still individual class
files (which makes them easy to write individually, of course). They
can still be run in that form - that's the difference between .NET and
Java. In Java although you *can* bundle classes together, you don't
have to.
If you want maximum control over the build, then use NAnt.
That doesn't help the development time though.
Then stop compiling every change to a file. Why would you even bother
recompiling after putting some whitespace into a comment?
I don't think I ever suggested that I'd recompile after changes quite
that minor (although as it's so cheap, you might as well save, and that
happens to compile). I still recompile very often (in Eclipse) though -
partly because of TDD, and partly because it just gives a warm fuzzy
feeling to *know* that you've got no compilation errors, because
everything *has* been compiled.
--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.
- Follow-Ups:
- Re: Why doesn't C# allow incremental compilation like Java?
- From: Andy
- Re: Why doesn't C# allow incremental compilation like Java?
- From: tjmadden1128@xxxxxxxxx
- Re: Why doesn't C# allow incremental compilation like Java?
- References:
- Why doesn't C# allow incremental compilation like Java?
- From: mwelsh1118
- Re: Why doesn't C# allow incremental compilation like Java?
- From: Nicholas Paldino [.NET/C# MVP]
- Re: Why doesn't C# allow incremental compilation like Java?
- From: mwelsh1118
- Re: Why doesn't C# allow incremental compilation like Java?
- From: Arne Vajhøj
- Re: Why doesn't C# allow incremental compilation like Java?
- From: Jon Skeet [C# MVP]
- Re: Why doesn't C# allow incremental compilation like Java?
- From: Andy
- Why doesn't C# allow incremental compilation like Java?
- Prev by Date: Re: Dynamic bean instantiation (reflection???)
- Next by Date: Re: Application.DoEvents and CPU problem
- Previous by thread: Re: Why doesn't C# allow incremental compilation like Java?
- Next by thread: Re: Why doesn't C# allow incremental compilation like Java?
- Index(es):
Relevant Pages
|