โ† Computer Science Fundamentals learning path
Computer Science Fundamentals ยท Module 8 of 10

Programming paradigms and compilers

Languages follow paradigms and are translated to machine code.

๐Ÿ“– Key ideas

  1. Imperative code says how to do steps; declarative code says what result you want (SQL).
  2. Object-oriented programming groups data and behaviour in objects.
  3. Functional programming uses pure functions and immutable data.
  4. Compilers translate the whole program ahead of time (C, Go, Rust).
  5. Interpreters run code line by line (Python); JIT compilers mix both (Java, JavaScript).
๐Ÿ’ก Real-life example: A compiler is a translator who translates a whole book before printing; an interpreter translates sentence by sentence as you listen.
CompilerTranslates code before running
InterpreterRuns code line by line
JITCompiles while the program runs
DeclarativeDescribe the result, not the steps