Skip to main content

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

TopicCore IdeaKey Skills
Introduction to ProgrammingPrograms are instruction sequencesRead/write basic scripts in Python
Variables and Data TypesNamed containers with typed valuesDeclare, initialise, and convert types
Control StructuresConditionals and loops direct flowWrite if/else, for, while correctly
Functions and RecursionReusable logic blocks, self-referential callsDefine functions, identify base cases
Pointers and Memory ManagementVariables that store addresses; malloc/freeAvoid leaks, dangling pointers
File HandlingPersistent read/write operationsUse open(), with, read(), write()
Debugging and TestingFinding and fixing bugs systematicallyUse debuggers, write unit tests, TDD
Basics of OOPCode organised as objects with state and behaviourClasses, inheritance, polymorphism

Key Terms

TermDefinitionRelated Concept
VariableA named memory location that stores a valueData Type
Data TypeSpecifies what kind of data a variable holds (int, float, string)Type Conversion
Control FlowThe order in which program statements executeLoops, Conditionals
FunctionA named, reusable block of code that performs a specific taskRecursion
RecursionA function that calls itself with a smaller input until a base case is reachedStack, Base Case
PointerA variable that holds the memory address of another variableMemory Allocation
HeapThe memory region for dynamically allocated data at runtimemalloc, free
EncapsulationBundling data and methods inside a class, hiding internalsOOP, Access Modifiers

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)

Pages in this directory: