Case Study 1: Setting Up a Computer Science Teaching Lab

Background

Dr. Patricia Olsen is the chair of the Computer Science department at Millbrook Community College. After years of teaching introductory programming with Python, she has decided to offer a new course: CS 110, "Structured Programming with Pascal." Her rationale is straightforward: too many students pass CS 101 (Python) without truly understanding variables, types, scope, or the compilation process — because Python hides all of these concepts. She wants a language that makes the foundations explicit.

The problem: she needs to set up 30 lab machines (24 Windows 10 desktops and 6 Ubuntu Linux workstations) with Free Pascal and Lazarus before the semester starts in three weeks. She has one teaching assistant, Marcus, who is a third-year student with Linux experience but no Pascal background. The department's IT support can help with software deployment but has never heard of Free Pascal.

The Challenge

Dr. Olsen's requirements:

  1. All 30 machines must have identical environments: the same version of Free Pascal, the same version of Lazarus, and the same default configuration.
  2. Students must be able to compile from both the command line and Lazarus.
  3. Student files must be saved to network storage (each student has a mapped network drive), not to the local machine — students move between machines.
  4. The installation must survive student misuse: students should not be able to break the compiler installation, even accidentally.
  5. IT support must be able to reimage machines without losing the Free Pascal installation (or reinstall it quickly).

The Solution

Phase 1: Creating a Reference Installation

Dr. Olsen and Marcus start by setting up one Windows machine and one Linux machine as reference installations.

Windows reference machine:

  1. Download Free Pascal 3.2.2 (x86_64-win64) installer from freepascal.org.
  2. Run the installer with default settings, installing to C:\FPC\3.2.2\.
  3. Verify: open PowerShell, run fpc -v — confirmed working.
  4. Download Lazarus installer (64-bit Windows) from lazarus-ide.org.
  5. Run the installer, installing to C:\Lazarus\.
  6. Launch Lazarus, verify it opens and can compile a test program.
  7. Configure Lazarus defaults: - Tools > Options > Environment > Files: Set the default project directory to H:\PascalProjects\ (the student's network drive letter). - Tools > Options > Editor > General: Tab width = 2, Smart tabs enabled. - Tools > Options > Editor > Display: Show line numbers enabled. - Tools > Options > Compiler > Paths: Add H:\PascalProjects\ as a default unit search path.
  8. Create a test project, compile, and verify the executable appears on the H: drive.

Linux reference machine:

  1. Install via sudo apt install fp-compiler lazarus.
  2. Verify: fpc -v in terminal — confirmed working.
  3. Launch Lazarus, verify operation.
  4. Configure Lazarus defaults similarly (project directory set to the NFS-mounted student home).

Phase 2: Scripted Deployment

Marcus writes deployment scripts to replicate the reference installation across all machines.

Windows deployment script (PowerShell, run as Administrator):

# install-fpc-lazarus.ps1
# Silent installation of Free Pascal and Lazarus for lab deployment

$FPCInstaller = "\\server\software\fpc-3.2.2.x86_64-win64.exe"
$LazInstaller = "\\server\software\lazarus-3.4-fpc-3.2.2-win64.exe"

# Install FPC silently
Start-Process -Wait -FilePath $FPCInstaller -ArgumentList "/SILENT /DIR=C:\FPC\3.2.2"

# Install Lazarus silently
Start-Process -Wait -FilePath $LazInstaller -ArgumentList "/SILENT /DIR=C:\Lazarus"

# Add FPC to system PATH
$fpcBin = "C:\FPC\3.2.2\bin\x86_64-win64"
$currentPath = [Environment]::GetEnvironmentVariable("Path", "Machine")
if ($currentPath -notlike "*$fpcBin*") {
    [Environment]::SetEnvironmentVariable("Path", "$currentPath;$fpcBin", "Machine")
}

# Copy pre-configured Lazarus settings
Copy-Item "\\server\software\lazarus-defaults\*" "C:\Lazarus\" -Recurse -Force

Write-Host "Installation complete. Please reboot to update PATH."

Linux deployment script (Bash):

#!/bin/bash
# install-fpc-lazarus.sh
sudo apt update
sudo apt install -y fp-compiler fp-units-rtl fp-units-base lazarus
# Copy default configuration
sudo cp /shared/lazarus-defaults/* /etc/lazarus/ 2>/dev/null
echo "Installation complete."

Phase 3: Configuration Management

The most subtle challenge is Lazarus configuration. Lazarus stores per-user settings in a directory:

  • Windows: C:\Users\<username>\AppData\Local\lazarus\
  • Linux: ~/.lazarus/

Since students log in with different accounts, each student gets their own Lazarus configuration on first launch. Dr. Olsen solves this with a default configuration template:

  1. Configure Lazarus exactly as desired on the reference machine.
  2. Copy the configuration directory to a network share.
  3. Add a login script that copies the default configuration to each student's local Lazarus directory if it does not already exist.

This way, every student starts with the same editor settings, the same default project directory, and the same compiler paths — but can customize their setup if they wish.

Phase 4: Student Account Setup

Each student's network drive (H:\ on Windows, ~/ on Linux) gets a pre-created directory structure:

H:\
  PascalProjects\
    Lab01\
    Lab02\
    ...
    Lab14\
    PennyWise\
      src\
      data\
      docs\

Marcus writes a script that creates this structure for all 90 enrolled students. The pre-created directories prevent the common first-lab disaster of students saving files in random locations and being unable to find them later.

Phase 5: Testing

Dr. Olsen runs a full test on every machine:

  1. Log in as a test student account.
  2. Open PowerShell / terminal, run fpc -v — verify the compiler is found.
  3. Navigate to H:\PascalProjects\Lab01\.
  4. Create test.pas with a Hello World program.
  5. Compile with fpc test.pas — verify successful compilation.
  6. Run the executable — verify output.
  7. Open Lazarus — verify it launches with correct default settings.
  8. Create a new Simple Program project, save to H:\PascalProjects\Lab01\.
  9. Compile and run from Lazarus — verify.
  10. Log out, log in on a different machine, navigate to H:\PascalProjects\Lab01\ — verify the files are there (network storage works).

Three machines fail the test: one has a corrupted Windows installation, and two have network drive mapping issues. Marcus fixes these individually.

Lessons Learned

1. Scripted deployment saves enormous time. Installing software on 30 machines by hand would have taken a full day. The scripted approach took two hours — including testing.

2. The PATH is the most common point of failure. On four machines, the PATH update did not take effect because the machines were not rebooted after installation. The fix: include a forced reboot in the deployment script.

3. Network drives change everything. When students save files to a network drive, compilation can be slightly slower (network I/O instead of local disk). For the small programs in an introductory course, this is negligible. But Dr. Olsen configured Lazarus to place compiled executables in a local temp directory to avoid unnecessary network traffic.

4. Default configuration is worth the effort. Without the login-script approach, every student would spend the first 15 minutes of lab configuring Lazarus settings — and half would get it wrong. The pre-configured defaults meant students could start coding immediately.

5. Test as the student, not as the administrator. Marcus initially tested the installation using his administrator account, where everything worked. It was Dr. Olsen who insisted on testing with a standard student account — which revealed that students did not have write permissions to C:\FPC\ (not needed) but also did not have the PATH set correctly (critical). Always test with the permissions your users will actually have.

Discussion Questions

  1. Why did Dr. Olsen choose Free Pascal and Lazarus rather than Delphi for the teaching lab? What are the advantages and disadvantages of each choice?

  2. The case study describes deploying to both Windows and Linux machines. What challenges arise when students work on both platforms? How does Pascal's cross-platform nature help?

  3. If a student accidentally deletes or corrupts their Lazarus configuration, what happens? How does the login-script approach help?

  4. Dr. Olsen's colleague argues that installing a full IDE for a beginning programming course is unnecessary — students should learn the command line first. What are the arguments for and against this position?

  5. How would this deployment scenario change if the college moved to cloud-based virtual desktops instead of physical lab machines? What would be easier? What would be harder?