Case Study 2: Teaching Programming in 2026 — The Case for Pascal

A pedagogical argument for using Pascal as a first programming language, with comparative analysis against Python, Java, C, and JavaScript.


The Problem

Dr. Sarah Okoro is a computer science professor at a mid-sized university. She has been teaching CS1 (Introduction to Computer Science) for twelve years — first with Java, then with Python. She has watched the same pattern repeat every semester:

  • Students learn to produce working Python programs within the first two weeks.
  • By week four, many students can complete assignments using techniques they do not understand: list comprehensions, string formatting, library imports.
  • By the midterm, a troubling gap appears: students who understand what they are doing (roughly 40%) and students who are expertly copy-pasting patterns they found online (roughly 60%).
  • By the end of the course, the copy-pasters can pass the exam (which tests whether you can produce working code) but struggle in CS2 (Data Structures), where understanding — not just output — matters.

Dr. Okoro's frustration is shared by many CS educators. The problem is not that students are lazy or unintelligent. The problem is that Python, by design, does not require understanding. You can write sorted(my_list, key=lambda x: x[1], reverse=True) without understanding what a lambda function is, what key does, or what sorted does internally. The code works. The student moves on. The understanding never forms.

She is considering switching to Pascal.


The Comparative Analysis

Dr. Okoro evaluates five languages against seven pedagogical criteria:

Criterion 1: Type System

Language Type System Pedagogical Impact
Pascal Static, strong, explicit Student must declare every variable's type. The compiler catches type errors immediately. Students learn to think about types from day one.
Python Dynamic, strong Student never declares types. Type errors appear only at runtime, often deep inside program execution. Students can avoid thinking about types entirely.
Java Static, strong, explicit Similar to Pascal, but verbose: ArrayList<String> names = new ArrayList<String>(); is intimidating for beginners.
C Static, weak Types are declared but the compiler allows dangerous implicit conversions (e.g., int to char*). Students learn types but also learn bad habits.
JavaScript Dynamic, weak "5" + 3 returns "53", "5" - 3 returns 2. The type system is actively hostile to understanding.

Winner for teaching: Pascal. Pascal's type system is strict enough to enforce discipline but simple enough to not overwhelm. Declaring var Age: Integer; is clear and teaches the concept. Java's equivalent is equally strict but more verbose.

Criterion 2: Error Messages

Language Error Message Quality Example
Pascal (FPC) Clear, pointing to the exact location with specific explanation Error: Incompatible types: got "String" expected "Integer"
Python Often clear for syntax errors, but runtime errors can be confusing with long tracebacks TypeError: can't multiply sequence by non-int of type 'float'
Java Clear for compilation errors, but lengthy; runtime errors produce stack traces that terrify beginners Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 5 out of bounds for length 5
C Famously cryptic: expected ';' before '}' token often points to the wrong line Notoriously difficult for beginners to interpret
JavaScript Console errors can be helpful, but undefined is not a function is a running joke Runtime errors in a dynamic language are inherently harder to diagnose

Winner for teaching: Pascal (FPC). Free Pascal's error messages are specific, locate the error precisely, and use language that beginners can understand.

Criterion 3: Program Structure

Language Minimum "Hello, World" Concepts Required
Pascal program Hello; begin WriteLn('Hello'); end. Program structure, begin/end block, procedure call
Python print("Hello") Function call only
Java public class Hello { public static void main(String[] args) { System.out.println("Hello"); } } Classes, access modifiers, static methods, arrays, object method calls
C #include <stdio.h> int main() { printf("Hello\n"); return 0; } Preprocessor, includes, function return types, escape characters
JavaScript console.log("Hello") Object method call

Analysis: Python and JavaScript have the simplest "Hello, World," but this simplicity hides concepts rather than teaching them. Pascal's version introduces exactly three concepts (program structure, block delimiters, procedure call) — an appropriate cognitive load for the first day. Java's version introduces at least six concepts, most of which cannot be explained until weeks later.

Winner for teaching: Pascal. It introduces the right amount of structure — not zero (Python) and not overwhelming (Java).

Criterion 4: Memory Model

Language Memory Model Pedagogical Value
Pascal Explicit: stack variables, heap allocation with New/Dispose Students learn where data lives and who is responsible for cleaning it up
Python Fully automatic (garbage collected, reference counted) Students never think about memory. This is efficient for productivity but harmful for understanding.
Java Garbage collected, stack/heap distinction partially visible Students learn about stack vs. heap but never manage memory themselves
C Fully manual: malloc/free, no safety checks Students learn memory management the hard way — segfaults, memory leaks, buffer overflows
JavaScript Fully automatic, opaque Students have no visibility into memory at all

Winner for teaching: Pascal. Pascal's memory model is explicit without being dangerous. Students learn that memory is a resource that must be managed, but Pascal's type checking prevents the worst hazards (buffer overflows, wild pointers) that make C traumatic for beginners.

Criterion 5: Control Flow Visibility

Language Control Flow Pedagogical Impact
Pascal Explicit: if..then..else, for..to, while..do, repeat..until, case..of Every control structure is a keyword. Control flow is visible in the code structure.
Python Significant whitespace: if, for, while Clean and readable, but indentation-as-syntax can confuse beginners (invisible bugs from mixed tabs/spaces)
Java C-style: if, for, while, braces Braces can be misplaced; dangling else problem exists
C C-style with additional pitfalls: if (x = 5) is legal (assignment, not comparison) Control flow bugs are common and hard to spot
JavaScript C-style with === vs == confusion, hoisting, implicit type coercion in conditions Numerous pitfalls that confuse beginners

Winner for teaching: Pascal. Pascal's begin..end delimiters are more explicit than braces (you cannot confuse { with (), := cannot be confused with =, and the separate loop constructs (for, while, repeat) teach students to choose the right tool for each situation.

Criterion 6: Ecosystem and Career Relevance

Language Ecosystem Job Market
Pascal Moderate (OPM, third-party libraries) Niche (Delphi jobs in specific industries)
Python Enormous (PyPI, 400,000+ packages) Large (data science, web, AI, automation)
Java Large (Maven Central, enterprise frameworks) Large (enterprise, Android, backend)
C Mature (OS-level, embedded) Moderate (systems, embedded, legacy)
JavaScript Enormous (npm, 2,000,000+ packages) Largest (web, frontend, backend, mobile)

Winner for career relevance: Python or JavaScript. This is Pascal's genuine weakness. Students who learn Pascal as a first language will need to learn a second language for career purposes. The question is whether the foundations Pascal provides make learning that second language easier and more effective.

Criterion 7: Transfer of Learning

Language Concepts that Transfer Concepts That Do Not Transfer
Pascal Types, variables, control flow, procedures/functions, records/classes, memory management, compilation Pascal-specific syntax
Python Variables, control flow, functions, OOP concepts Dynamic typing habits, reliance on implicit behavior, library-dependent problem solving
Java Types, OOP, compilation, interfaces Verbosity habits, over-engineering, framework dependency
C Memory management, low-level understanding, compilation Unsafe habits (pointer arithmetic, manual everything)

Winner for transfer: Pascal. The habits formed in Pascal — explicit typing, careful memory management, structured decomposition — transfer positively to every other language. The habits formed in Python — reliance on dynamic typing, library-first problem solving — can transfer negatively, creating students who can use tools but not build them.


Dr. Okoro's Decision

After the analysis, Dr. Okoro decides to pilot Pascal in one section of CS1 while maintaining Python in the other sections. Her hypothesis: Pascal students will score lower on early assignments (because Pascal requires more setup per program) but higher on the CS2 final exam (because they will have stronger foundational understanding).

She chooses Free Pascal + Lazarus because: 1. Free and open-source. No cost barrier for students. 2. Cross-platform. Students use Windows, macOS, and Linux. 3. Integrated IDE. Lazarus provides an editor, compiler, and debugger in one package. 4. Progressive complexity. Students start with console programs (Parts I-IV) and advance to GUI programs (Part V) — a natural progression that Python's IDLE does not support as smoothly.


The Counter-Argument

Dr. Okoro's colleague, Professor Chen, pushes back. His arguments:

  1. Student motivation. Python lets students build "cool things" quickly — web scrapers, data visualizations, chatbots. This early sense of accomplishment keeps students engaged. Pascal's initial programs are less visually exciting.

  2. Industry relevance. Students (and their parents) expect CS education to lead to jobs. Employers list Python and JavaScript in job postings, not Pascal.

  3. Learning resources. Python has thousands of tutorials, courses, and Stack Overflow answers. Pascal's learning resources are fewer and sometimes outdated.

  4. AI integration. Python has TensorFlow, PyTorch, and scikit-learn. Students in 2026 expect to work with AI tools, and Python is the lingua franca of AI.

These are valid points. Dr. Okoro does not dismiss them. Her response: "I am not teaching them a language. I am teaching them to think. The language is a vehicle, not a destination. Pascal is the best vehicle for building the thinking skills that will serve them in every language they learn after this one — including Python."


Preliminary Results

After one semester, Dr. Okoro compares results:

Metric Pascal Section Python Sections
CS1 final exam average 78% 82%
CS2 midterm average (following semester) 84% 71%
"Can explain how a linked list works" (CS2 survey) 89% 52%
"Confident debugging unfamiliar code" (CS2 survey) 76% 48%
Self-reported enjoyment of CS1 3.6/5.0 4.1/5.0

The Pascal section scored slightly lower on the CS1 final (which tested whether students could produce working programs) but significantly higher on the CS2 midterm (which tested whether students understood data structures and algorithms). The self-reported enjoyment was slightly lower for Pascal, but the confidence and understanding metrics were substantially higher.

Dr. Okoro's conclusion: Pascal produces students who enjoy the first course slightly less but understand computer science significantly more. Whether this tradeoff is worth making depends on what you believe computer science education is for: producing people who can code, or producing people who can think.

She continues the pilot. She adopts this textbook.