Overview of Programming Languages

Oct 9, 2024

Types of Programming Languages

Definition

  • Programming language: An artificial language designed to communicate instructions to machines (especially computers).
  • Used to create programs that control machine behavior (e.g., computers, rockets, smart TVs).
  • A program = a list of instructions in a programming language.

Popular Programming Language

  • Java is currently one of the most popular programming languages.

Classification of Programming Languages

Programming languages are divided into two main categories:

  1. Low-Level Languages

    • Languages that the machine understands directly.
    • Types:
      • Machine Language:
        • Numeric (series of bits: 0s and 1s).
        • Tedious and error-prone to write manually.
        • Not portable (specific to machine type).
      • Assembly Language:
        • Reduces errors and time-consuming machine programming.
        • Uses mnemonic codes to represent machine instructions (e.g., move, jump, cmp, add).
        • Specific to certain computer architectures (e.g., MIPS, x86).
  2. High-Level Languages

    • More user-friendly and closer to human language.
    • Types:
      • Procedural Languages:
        • Programs written as a sequence of steps to solve a problem (e.g., recipe instructions).
        • Follow a top-down approach focusing on functions.
        • Disadvantage: Data is not secure, code is interdependent, which complicates reuse.
      • Object-Oriented Languages:
        • Programs written as interactions between objects.
        • Objects maintain internal data and expose functions for others to use (e.g., fridge and microwave interaction).
        • Follow a bottom-up approach with a focus on data.
        • Advantages: Models real-world interactions, secures data, modular code, and extensibility.

Translation of High-Level Languages

  • High-level language code needs to be translated into machine language using:
    • Compiler: Translates high-level instructions into machine language and generates an executable file (e.g., .exe).
    • Interpreter: Translates and executes high-level instructions line by line.

Next Steps

  • The next video will cover object-oriented concepts in Java.