Programming Layer
IB Syllabus: Theme B - Computational Thinking & Problem-Solving (B2, B3)
Programming is the layer where abstract ideas become concrete. A loop is not just syntax - it is iteration. An array is not just a data structure - it is a block of contiguous memory. An object is a model of something real.
This layer uses code as a vehicle for understanding how computers process information, how algorithms work, and how to think computationally. Every example is written in both Java and Python (the two IB CS languages): use the tabs on any code block to pick yours, and the site remembers the choice. The goal is not to memorise a language - it is to use one to reason about problems.
Interactive quizzes are graded against the Java versions. When you are viewing Python, questions that test a Java-specific detail carry a small Java label, so you always know which language option a question belongs to.
What You Will Build Towards
The programming layer follows a deliberate progression:
- Fundamentals - data types, variables, operators, input/output, debugging
- Constructs - sequence, selection, iteration, functions, scope
- Data Structures - arrays, ArrayLists, stacks, queues
- Algorithms - searching, sorting, Big O complexity
- File Processing - reading, writing, and appending data to files
After this foundation, the layer continues into:
- Object-Oriented Programming (B3): classes, objects, encapsulation, UML design
- JavaFX + MVC: building real-world graphical applications for the IA
- Abstract Data Types (B4, HL): building linked lists, BSTs, sets, and hash maps from scratch
IB Syllabus Coverage
| # | Topic | Syllabus | Key Concepts | Level |
|---|---|---|---|---|
| 1 | Programming Fundamentals | B2.1 | Variables, data types, strings, exceptions, debugging | SL + HL |
| 2 | Programming Constructs | B2.3 | Sequence, selection, loops, functions, scope | SL + HL |
| 3 | Data Structures | B2.2 | Arrays, ArrayList, stacks (LIFO), queues (FIFO) | SL + HL |
| 4 | Algorithms & Complexity | B2.4 | Big O, linear/binary search, bubble/selection sort; HL: recursion, quicksort | SL + HL |
| 5 | File Processing | B2.5 | Reading, writing, appending files | SL + HL |
| 6 | Abstract Data Types | B4.1 | Linked lists, BSTs, sets, hash maps | HL |
How to Use This Layer
- Start with Programming Fundamentals if you are new to programming or need a refresher on data types and operators.
- Work through Programming Constructs to master
if/else, loops, and methods - these appear in every program. - Data Structures and Algorithms are closely related - understanding how data is stored shapes which algorithms make sense.
- File Processing connects your programs to the real world: data persists beyond a single run.
IB Paper 2 questions require you to trace code, identify errors, and write short algorithms. The trace table exercises in each section prepare you directly for this.