1. Programming Fundamentals
Learning Objectives
- Explain what programming is and why it matters in modern software development
- Declare and use variables with appropriate data types in multiple languages
- Apply control structures to direct program flow with conditionals and loops
- Define and call functions, including recursive functions with proper base cases
- Describe how pointers and memory allocation work in low-level languages
- Perform file reading, writing, and error handling in Python
- Identify and apply the six core OOP principles: objects, classes, encapsulation, abstraction, inheritance, and polymorphism
Quick Answer
Programming Fundamentals covers the essential building blocks that every software developer uses daily. You start by learning what a program is — a precise set of instructions for a computer — and then move through variables (named storage), data types (what kind of data a variable holds), and operators. Control structures (if/else, loops) let you direct the flow of execution, while functions package reusable logic. Recursion extends functions to self-referential problems. Memory management explains how programs request and release RAM, especially in C and C++. File handling adds persistence, and object-oriented programming organises everything into reusable, self-contained objects.
Topics at a Glance
| Topic | Core Idea | Key Skills |
|---|---|---|
| Introduction to Programming | Programs are instruction sequences | Read/write basic scripts in Python |
| Variables and Data Types | Named containers with typed values | Declare, initialise, and convert types |
| Control Structures | Conditionals and loops direct flow | Write if/else, for, while correctly |
| Functions and Recursion | Reusable logic blocks, self-referential calls | Define functions, identify base cases |
| Pointers and Memory Management | Variables that store addresses; malloc/free | Avoid leaks, dangling pointers |
| File Handling | Persistent read/write operations | Use open(), with, read(), write() |
| Debugging and Testing | Finding and fixing bugs systematically | Use debuggers, write unit tests, TDD |
| Basics of OOP | Code organised as objects with state and behaviour | Classes, inheritance, polymorphism |
Key Terms
| Term | Definition | Related Concept |
|---|---|---|
| Variable | A named memory location that stores a value | Data Type |
| Data Type | Specifies what kind of data a variable holds (int, float, string) | Type Conversion |
| Control Flow | The order in which program statements execute | Loops, Conditionals |
| Function | A named, reusable block of code that performs a specific task | Recursion |
| Recursion | A function that calls itself with a smaller input until a base case is reached | Stack, Base Case |
| Pointer | A variable that holds the memory address of another variable | Memory Allocation |
| Heap | The memory region for dynamically allocated data at runtime | malloc, free |
| Encapsulation | Bundling data and methods inside a class, hiding internals | OOP, Access Modifiers |
Related Topics
Prerequisites: Basic computer literacy, understanding of number systems
Related Topics: Data Structures and Algorithms, Object-Oriented Programming, Debugging Tools
Next Topics: Data Structures and Algorithms (arrays, linked lists, trees build directly on these fundamentals)