What is the difference between" compile time "and"run time"?

Compile time and run time are common terms that we often hear in the programming area, what are the main differences or characteristics of these two terms?

 19
Author: Maniero, 2017-06-29

2 answers

O compile time or compile time is everything that occurs during the compilation process, everything that can be detected, generated, optimized, performed when the code is being compiled. In general it is where you get syntactic, lexical and semantic errors, typing or even, in conjunction with other tools, validate with unit test or other analysis called static.

Already run time or runtime is everything that happens when the code is already running, so there if there is a problem it may be too late to solve. On the other hand it may be that only at that moment with the right data it is possible to understand what occurs, what can be optimized, etc. Errors dependent on the data to be processed often stop execution if there is no mechanism to handle it. In general, direct or indirect data inputs will determine what will occur.

For robustness and better performance we often say that it is better to solve everything that gives at compile time, and it is one of the reasons interpreted languages are considered "inferior" since they usually have only the runtime. But there are cases that rightly leave for runtime is the only or best way out.

The term link time can also be used for the can be solved in time of linkedition, but it is rarer.

Some languages have the dynamic link time , i.e. right before runtime, and not right after compilation. Some do so structured and complex with a specific mechanism that we use the term JIT time.

Still exists design time, which has a slightly different context. It refers to the moment the code is being created, that is, it is before the compilation and may have the aid of some tool.

Last o term development time can still be used for the entire development cycle in counterpoint to the production cycle.

 19
Author: Maniero, 2020-05-28 16:34:38

Compile Time - compile time:

Obvious problems in the code such as syntax errors are detected during compilation.

Run Time - run time:

Errors can also occur during execution. These can be caused by inappropriate inputs that have not undergone any treatment or other occurrence that could not have been detected as an error by the compiler. Examples: the program expects a number and a letter is typed, or the program tries to use a variable that was not started and gives a NullPointerException, etc.

 5
Author: Antonio Alexandre, 2017-06-30 08:31:49