Reading COBOL
1959 wrote the most readable code in the world — and it's your bridge from vibe coder to live coder.
42 seconds · English captions included · 7.8 Mo
The 7 things you'll know how to do
Lesson 4: Reading COBOL
Regarde la leçon (42 s) : le code le plus lisible jamais écrit est aussi le tuteur le plus honnête que tu auras eu.
COBOL is a sentence
Traduis cette phrase COBOL en Ruby : « MOVE "salut" TO greeting » — le contenu part dans la variable `greeting`.
Conditions, in full words
Traduis : « IF MONTANT IS GREATER THAN 1000 » — avec `montant = 1500` ET `petit = 500`, la variable `gros` doit valoir true et `petit_gros` false.
The loop, in full words
Traduis : « PERFORM 3 TIMES / ADD 1 TO COMPTEUR » — `compteur` doit finir à 3 (il part de 0).
COMPUTE, no surprise
Traduis : « COMPUTE TOTAL = PRIX + TAXE » — avec `prix = 10` et `taxe = 2`, `total` doit valoir 12 (et suivre si prix change).
Read before you code
Ce paragraphe COBOL dit : `MOVE 5 TO x`, puis `ADD 2 TO x` (deux fois), puis `IF x IS GREATER THAN 8` → `MOVE "gros" TO verdict`. Écris le Ruby qui produit exactement ça.
Lesson 4: OK
Sans aide — traduis ce mini-paragraphe : `MOVE 0 TO total`, `ADD 3 TO total`, `ADD 4 TO total`, `IF total IS GREATER THAN 6 THEN MOVE "ok" TO verdict`. Résultat attendu : total = 7, verdict = "ok".
📄 The cheat sheet
print it, stick it on your monitor, pretend it was your idea📄 Cheat sheet — Reading COBOL (your vibe → live bridge)
COBOL isn't an old language. It's a mirror: code written in full words.
Why learn to READ COBOL
- It's text. No magic symbols — sentences. If you can read it, you're already reading logic.
- The grammar is universal.
IF,PERFORM,COMPUTE=if,.times,=. The words change, the logic never. - Banks still run on it. Understanding the past is understanding why the present looks like this.
- Vibe → live: a vibe coder copies, a live coder understands. This vocabulary is the bridge.
The COBOL → Ruby dictionary (4 lines and you're a translator)
| COBOL (read it out loud) | Ruby (write this) |
|---|---|
MOVE "salut" TO greeting |
greeting = "salut" |
IF MONTANT IS GREATER THAN 1000 |
if montant > 1000 |
PERFORM 3 TIMES + ADD 1 TO compteur |
3.times { compteur += 1 } |
COMPUTE TOTAL = PRIX + TAXE |
total = prix + taxe |
The 3-step method
READ → out loud, like a sentence from your mother
UNDERSTAND → who gives what to whom? (MOVE = gives, TO = to)
CODE → the same thing, in Ruby
A whole paragraph, taken apart
MOVE 0 TO total. total = 0
ADD 3 TO total. total += 3
ADD 4 TO total. total += 4
IF total IS GREATER THAN 6
MOVE "ok" TO verdict.
→ total == 7 and verdict == "ok". You just read 1959 code. 😉 Without Google.
The 3 local quirks (for laughs, but true)
- COBOL is written in CAPS everywhere — Ruby doesn't care, but read it anyway.
IS GREATER THAN=>,IS EQUAL TO===(equality, not assignment — same confusion as C!).- No
THENin Ruby:if …is enough. COBOL wants one, Ruby doesn't.
Never say again
"the old folks' language"→ the language that made code readable before everyone else"I code blind"→ you just translated a COBOL paragraph. Live coder suits you fine.
SlopCourse — from slop to clean code.