Differences between compiling and recompiling?

Some IDEs like Visual Studio have the options to compile and recompile the project, what is the difference between the two and what do they perform differently? And when should each be used?

Author: Maniero, 2017-07-20

2 answers

I imagine you're talking about buildand rebuild which is a bit different from compiling and recompiling.

The exact semantics can vary and it is not so much the IDE, it is the project building system that the IDE reproduces in GUI.

Building takes advantage of what you already have, it's called incremental construction. For example, everything it detects it doesn't need to generate a new executable it doesn't generate. In general this is checked when the time of what has been changed in the code and that the executable is with previous time, need to generate a new one.

Rebuilding starts all from scratch as if nothing had been done with that before, which obviously takes longer, but avoids picking up something that is already out of date.

 12
Author: Maniero, 2020-06-02 17:16:19

If you are talking about C# and VB.Net (I can't state others): the main difference is that rebuild (recompile) does a clean in the project and then do a build (compile).

While the Build will check all the files that have been changed and try to compile only what has been modified. Rebuild will compile everything from scratch.

 13
Author: LINQ, 2017-12-04 15:20:28