Programming Languages and Program Development
Programming Languages Overview
- Programming Language: A standardized method of telling a computer what to do using defined syntax rules.
- High-Level Languages: Built for human readability and hardware abstraction; features portability and faster development using English-like syntax (e.g., Python, Java, C++).
- Low-Level Languages: Hardware-dependent languages sitting close to the CPU (e.g., Assembly); uses short symbolic codes to trade readability for execution speed and precise control.
Language Translators
- Compiler: Translates high-level source code into machine code by reading code, checking syntax rules, converting instructions, and handing them to the CPU.
- Assembler: Translates assembly language symbolic code into machine code.
- Function: Serves as an essential translator so CPU hardware can execute human-written code.
Program Development Life Cycle (PDLC)
- Problem Definition: Identifying the core objective, required inputs, and expected outputs.
- Problem Analysis: Studying the problem logic to connect inputs to outputs before writing code.
- Algorithm: A language-independent, step-by-step set of instructions for solving a problem.
- Pseudocode: An informal, logic-focused representation of an algorithm without strict syntax (e.g., START, Input num1 num2 num3, SUM = total, Print SUM, END).
- Coding: Writing actual source code following the precise syntax rules of a language.
- Debugging: The process of testing, finding, and fixing errors (bugs) in the source code.
Error Types
- Compile-Time Errors:
- Caused by syntax rule violations (e.g., missing semicolons, misspelled commands, missing closing brackets).
- Detected early by the compiler and blocks the program from running until fixed.
- Runtime Errors:
- Caused by logic mistakes that occur while the program is executing (e.g., division by zero, infinite loops).
- Passes compilation without warnings and produces wrong behavior or crashes during operation.