Programming - What is the difference between runtime and compile time?

What is the difference between runtime and compile time?

  • Runtime and compile time are programming terms that refer to different stages of software program development.

compile time

In order to create a program, a developer first writes source code, which defines how the program will function. Small programs may only contain a few hundred lines of source code, while large programs may contain hundreds of thousands of lines of source code. The source code must be compiled into machine code in order to become and executable program. This compilation process is referred to as compile time.

Runtime

A compiled program can be opened and run by a user. When an application is running, it is called runtime.

The terms “runtime” and “compile time” are often used by programmers to refer to different types of errors.

compile time error

A compile time error is a problem such as a syntax error or missing file reference that prevents the program from successfully compiling. The compiler produces compile time errors and usually indicates what line of the source code is causing the problem.

  • 신택스 오류
  • 타입체크 오류

Rungime error

If a program’s source code has already been compiled into an executable program, it may still have bugs that occur while the program is running. Examples include features that don’t work, unexpected program behavior, or program crashes. These types of problems are called runtime errors since they occur at runtime.

  • 0나누기 오류
  • 널(Null)참조 오류
  • 메모리 부족 오류