Compile time and run time are common terms we often hear in the programming area, what are the main differences or characteristics of these two terms?
Compile time and run time are common terms we often hear in the programming area, what are the main differences or characteristics of these two terms?
The compile time or compile time is everything which 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 can get syntactic, lexical and semantic errors, typing or even, together with other tools, validate with unit test or other analysis called static.
Already run time or time execution is all that occurs when the code is already running, so there if there is a problem it may be too late to troubleshoot. On the other hand it may be that only at that moment with the right data is it possible to understand what is happening, what can be optimized, etc. Dependent errors of the data being processed usually paralyze execution if there is no mechanism that deals with it. In general direct or indirect data entries will determine what will happen.
For robustness and better performance we say that it is better to solve everything that gives at compile time, one reason why interpreted languages are considered "inferior" since they usually have only the execution time. But there are cases that just leave it to runtime is the only or best output.
The term link time can also be used for it can be resolved at linking time, but it is rarer.
>Some languages have dynamic link time , that is, just before the execution time, not soon after compilation. Some do so structured and complex with a specific mechanism that we use the term JIT time .
There is still design time , which has a slightly different context. It refers to the moment that the code is being created, ie it is before the compilation and can be helped by some tool.
Finally, the term development time can still be used for the entire development cycle as a counterpoint to the production cycle.
Compile Time - Compile Time:
During compilation, obvious code problems are detected as syntax errors.
Run Time - Runtime:
Errors can also occur during execution. These can be caused by improper 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.