The Operon
This cell has a problem: milk sugar (lactose) is food it can't eat — until it builds a tool called lactase. So it carries a gene that says, in effect: "only build lactase IF lactose shows up." That's an if-statement. Nature wrote it about two billion years before we did, and it runs inside you right now. Let's run one ourselves.
Milk in the environment
40Sugar has to drift into the cell before the gene can see it. Biology is slow; CPUs are fast.
the program this cell runs, ~8× a second — watch the bright branch:
What you're watching: the gene never changes — the input changes, and the output follows.
Slide milk to zero and the gene goes dark. Flood the cell and it lights up.
Every program you'll ever write has this same skeleton: read input → branch → output.
You now understand if / else. E. coli agrees.