CompTIA Tech+ (FC0-U71)Software Development ConceptsMedium

A junior developer is confused about the difference between compiled and interpreted programming languages. Which of the following statements accurately describes a key characteristic of compiled languages?

  1. AErrors are usually detected only during runtime execution.
  2. BSource code is translated into machine code before execution.
  3. CCode is executed line by line by an interpreter at runtime.
  4. DPrograms are typically platform-independent due to runtime interpretation.
Show answer & explanation

Correct answer: B. Source code is translated into machine code before execution.

Compiled languages translate the entire source code into machine-executable code (an executable file) before the program runs. This pre-compilation step allows for early error detection and generally results in faster execution.

Why the other options are wrong

  • A. Compiled languages detect most syntax and type errors during the compilation phase, before runtime.
  • C. This describes an interpreted language, not a compiled one.
  • D. Interpreted languages are often more platform-independent; compiled languages typically produce platform-specific executables.

Compiled Language

A type of programming language where the source code is translated directly into machine code (or an intermediate bytecode) by a compiler before the program is executed. The resulting executable file can then be run independently.

  • Requires a compilation step before execution.
  • Results in faster execution speeds because code is pre-translated.
  • Errors are largely detected during compilation (compile-time errors).
  • Executables are typically platform-specific (e.g., Windows .exe, Linux ELF).

Memory trick: Compiled: 'Compile' it once, then 'run' it fast.

More Software Development Concepts questions