Programming fundamentals
BRIDGE · EE Foundations Bridge · ~10 min
A program is a precise sequence of instructions — like a work order a very fast, very literal apprentice executes exactly as written. Three structures cover most of it: variables store values (a voltage reading, a running total), conditionals branch (IF the reading exceeds 3% THEN flag it), and loops repeat (FOR every circuit in the panel, compute its load).
The connection to Unit B.5 is direct: conditionals are Boolean logic in action. `if (hot && !neutral)` is an AND gate with a NOT — the same algebra, executed by code instead of copper.
For someone in the trades, programming is leverage: a 20-line script can compute voltage drop for 500 circuits, generate a panel schedule, or log meter readings — FreeTradeCamp's own Formula Lab is nothing more than these three structures wearing a nice interface.
Go deeper: Harvard's CS50 — the gold-standard free introduction to programming — Semester 2 of the Go Deeper pathway.
Quiz — 3 questions
1. To apply the same voltage-drop calculation to 200 circuits, a program uses a:
2. `if (currentA > 20) trip()` is the software equivalent of:
3. The Boolean expression `A && !B` reads: