Differences between compile and recompile?

10

Some IDEs like Visual Studio have the options of compiling and recompiling the project, what is the difference between the two and what do they do differently? And when should each be used?

    
asked by anonymous 20.07.2017 / 14:53

2 answers

10

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

The exact semantics can vary and neither is IDE, it's the project building system that IDE replicates in GUI.

Build leverages what it already has, it's called incremental construction. For example, everything it detects does not need to generate a new executable it does not generate. In general this is checked when the time of what was changed in the code and that the executable is with previous time, needs to generate a new one.

Rebuilding starts from scratch as if nothing had been done with it before, which obviously takes longer, but avoid getting something that is already out of date.

    
20.07.2017 / 15:06
10

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

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

    
20.07.2017 / 15:06