10. Control Flow (The If/Then Conditionals)
Objective: Master the 4 levels of "If/Then" logic gates to discuss facts, future possibilities, hypothetical scenarios, and past post-mortems.
Part 1: Standard Library Upgrade (Pre-Compiled Blocks)
Instructor Note: Memorize these as complete, unbreakable blocks of code.
A. The Corporate API
| The Block | The Logic | Execution |
|---|---|---|
| Roll back | To revert software or a decision to a previous, stable version. | "If the update fails, we will roll back to version 1.0." |
| Sign off on | To give official, final approval for a project or document. | "We cannot start coding until the client signs off on the design." |
B. The Casual API
| The Block | The Logic | Execution |
|---|---|---|
| Drop by | To visit someone casually and briefly without a strict appointment. | "If I walk around Brookefield tonight, I might drop by your place." |
| Hold off on | To delay doing something until a later time or condition is met. | "Let's hold off on dinner until my brother gets home." |
Part 2: The System Boundaries (The Conditional Matrix)
There are exactly 4 levels of If/Then statements in the English Operating System. The level you choose depends entirely on the reality of the situation.
The Syntax Rule: Every conditional has two blocks of code: The IF block (the trigger) and the RESULT block (the output). You can swap their order, but the internal variables must remain strict.
| Level | Reality Status | The IF Block (Trigger) | The RESULT Block (Output) | Execution Example |
|---|---|---|---|---|
| Level 0 (Zero) | Hardcoded Fact | Present Simple (V1/V5) | Present Simple (V1/V5) | "If the server overheats, it crashes." |
| Level 1 (First) | Real Future | Present Simple (V1/V5) | Modal (WILL + V1) | "If the client signs off, we will deploy." |
| Level 2 (Second) | The Sandbox (Hypothetical Now) | Past Simple (V2) | WOULD + V1 | "If I had the password, I would fix it." |
| Level 3 (Third) | Fatal Error (Past Post-Mortem) | Past Perfect (Had + V3) | WOULD HAVE + V3 | "If we had tested it, it would not have crashed." |
Advanced System Interaction: The Complete Passive Conditional Matrix
You can shift the "camera angle" to the Passive Voice inside ANY level of an If/Then statement. You simply replace the active verb with the Passive Code Block (BE Gate + V3).
| Level | Reality Status | The Passive IF Block (Trigger) | The Passive RESULT Block (Output) | Execution Example |
|---|---|---|---|---|
| Level 0 | Hardcoded Fact | is/are + V3 | is/are + V3 | "If an issue is escalated, it is logged in the system." |
| Level 1 | Real Future | is/are + V3 | will be + V3 | "If the design is signed off on, the update will be pushed to production." |
| Level 2 | Hypothetical Now | were + V3 (Sandbox Override) | would be + V3 | "If a bug were found, the issue would be escalated immediately." |
| Level 3 | Past Post-Mortem | had been + V3 | would have been + V3 | "If the code had been tested, the database would not have been corrupted." |
Part 3: System Warnings & Deprecated Code
Note: These are the two most common syntax errors non-native speakers make when writing Control Flow logic. Guard against these strictly.
1. The "Double Future" Crash:
You can NEVER put a future modal (will or would) inside the IF block. The IF block must always use a present or past tense to set the condition. The modal only goes in the RESULT block.
- Fatal Error: "If the client will sign off on this, we will start."
- Clean Code: "If the client signs off on this, we will start."
2. The Sandbox Override (Level 2 Exception): When writing Level 2 (Hypothetical Sandbox) code using the "BE Gate," the system overrides standard Noun/Verb agreement. Instead of using "was" for singular nouns (I, he, she, it), the system permanently forces the use of "were" to flag that this is a fake, hypothetical reality.
- Fatal Error: "If I was the CEO, I would roll back the update."
- Clean Code: "If I were the CEO, I would roll back the update."
Part 4: Interactive Code Refactoring (20 Questions)
Instructions for the student: Identify the intended level of the conditional (0, 1, 2, or 3) and fix the corrupted syntax. You must integrate the new Standard Library vocabulary where appropriate.
1. (Corporate - Level 1): "If the freelance contract will be approved tomorrow, I start working immediately."
- Refactor: 2. (Casual - Level 2): "If I was you, I will hold off on buying a new MacBook until the Apple event."
- Refactor: 3. (Corporate - Level 3): "If the junior developer didn't push the broken code, we wouldn't have to roll back the server."
- Refactor into a strict Level 3 Post-Mortem: 4. (Casual - Level 1): "If you will make overnight oats for brunch, I drop by to eat with you."
- Refactor: 5. (Corporate - Level 0): "If a client is not signing off on the wireframes, the project is stalling."
- Refactor into pure Level 0 (Hardcoded Facts):
6. (Corporate - Level 2): "If we have more bandwidth, we will not hold off on the UI redesign."
- Refactor into Level 2 (Hypothetical - we don't actually have bandwidth right now):
7. (Casual - Level 3): "If I knew you were walking near Brookefield last night, I would drop by to say hello."
- Refactor into Level 3 (You didn't know, and you didn't drop by):
8. (Corporate - Bug Fix): "We will roll back the database if the migration will fail."
- Refactor (Fix the Double Future crash):
9. (Casual - Level 1): "If I will add extra chili to the recipe, it is perfectly spicy."
- Refactor:
10. (Corporate - Bug Fix): "If the IT director was here, he would sign off on the security patch."
- Refactor (Fix the Sandbox Override bug):
11. (Casual - Level 2): "If I don't have to teach Python this weekend, I will whip up a massive dinner."
- Refactor into Level 2 (Hypothetical - you DO have to teach):
12. (Corporate - Level 3): "If the backup server didn't fail, we didn't lose the client's data."
- Refactor into a strict Level 3 Post-Mortem:
13. (Casual - Bug Fix): "I drop by your office tomorrow if I finish my freelance work early."
- Refactor:
14. (Corporate - Level 1): "If we will roll back the update now, the users will not experience any downtime."
- Refactor:
15. (Corporate - Level 2): "If I was the lead architect, I will sign off on this API immediately."
- Refactor:
16. (Casual - Level 0): "If you are soaking oats overnight, they are tasting much better the next day."
- Refactor into pure Level 0 (Global constant facts):
17. (Corporate - Bug Fix): "We would not have lost the files if we roll back the system yesterday."
- Refactor:
18. (Casual - Level 3): "If we didn't hold off on buying the tickets, we would go to the concert last night."
- Refactor into Level 3:
19. (Corporate - Level 1): "If the manager signs off on the budget, we buy the Lenovo workstation."
- Refactor:
20. (Corporate/Casual - Full Refactor): "If I was not a freelancer, I will have to ask a boss to sign off on my vacation days. I am glad I can just hold off on taking projects when I want a break."
- Refactor the first sentence into correct Level 2 Sandbox logic:
Part 5: Advanced System Interaction (Passive Conditionals)
Instructions for the student: These 5 statements attempt to combine the Passive Voice with If/Then logic, but the code is corrupted. Identify the conditional level, fix the passive syntax, and watch out for Sandbox Overrides and Double Future crashes.
21. (Corporate - Level 1 Passive): "If the wireframes will be signed off on tomorrow, the new UI will push to production."
- Refactor (Fix the Double Future crash in the IF block, and fix the broken passive in the RESULT block):
22. (Corporate - Level 2 Passive Sandbox): "If the main server was hacked, the database would roll back to yesterday's backup."
- Refactor (Fix the Sandbox Override bug in the IF block, and ensure the RESULT block is properly passive):
23. (Corporate - Level 3 Passive Post-Mortem): "If the code had tested properly, the deployment would not have held off on."
- Refactor into a strict Level 3 Passive (The code didn't test itself; it was tested. The deployment didn't hold off; it was held off):
24. (Casual - Level 1 Passive): "If dinner is whipped up quickly, the movie will not hold off."
- Refactor (Fix the RESULT block so the movie is receiving the action passively):
25. (Corporate - Level 2 Passive): "If the issue was escalated to the CEO, the new budget would approve immediately."
- Refactor (Apply the Sandbox Override in the IF block, and fix the RESULT block so the budget receives the approval):
Click here to view the System Output (Answer Key)
Part 4: Standard Conditionals (Levels 0-3)
1. (Corporate - Level 1): * The Bug: will be approved (in the IF block), start (in the RESULT block)
- The Logic: Double Future Crash. The IF block cannot take "will." Because this is a real future event (Level 1), the IF block needs Present Simple, and the RESULT block needs the Modal.
- Clean Code: "If the freelance contract is approved tomorrow, I will start working immediately." (Or using the new API: "If the client signs off on the freelance contract tomorrow, I will start working immediately.")
2. (Casual - Level 2): * The Bug: was, will hold off on
- The Logic: Sandbox Override. When using the BE Gate in a fake, hypothetical present (Level 2), "was" permanently becomes "were." The RESULT block requires "would" to show it is a hypothetical output.
- Clean Code: "If I were you, I would hold off on buying a new MacBook until the Apple event."
3. (Corporate - Level 3): * The Bug: didn't push, wouldn't have to roll back
- The Logic: This is a Post-Mortem. The event is already finished in the past. It requires the Level 3 Double Past (Past Perfect) for the trigger, and "would have + V3" for the output.
- Clean Code: "If the junior developer had not pushed the broken code, we would not have had to roll back the server."
4. (Casual - Level 1): * The Bug: will make, drop by
- The Logic: Double Future Crash. Move the future Modal to the RESULT block.
- Clean Code: "If you make overnight oats for brunch, I will drop by to eat with you."
5. (Corporate - Level 0): * The Bug: is not signing off, is stalling
- The Logic: Level 0 is for global constants and hardcoded facts. It requires pure Present Simple (V1/V5) in both blocks, not Present Continuous.
- Clean Code: "If a client does not sign off on the wireframes, the project stalls."
6. (Corporate - Level 2): * The Bug: have, will not hold off on
- The Logic: This is a hypothetical sandbox (they do not actually have bandwidth right now). It requires Level 2: Past Simple trigger + "Would" output.
- Clean Code: "If we had more bandwidth, we would not hold off on the UI redesign."
7. (Casual - Level 3): * The Bug: knew, would drop by
- The Logic: The walking happened last night (a finished timeline). This requires a Level 3 Post-Mortem.
- Clean Code: "If I had known you were walking near Brookefield last night, I would have dropped by to say hello."
8. (Corporate - Bug Fix): * The Bug: will fail (inside the IF block)
- The Logic: Double Future Crash. The condition must be Present Simple.
- Clean Code: "We will roll back the database if the migration fails."
9. (Casual - Level 1): * The Bug: will add, is
- The Logic: Double Future Crash. Move the Modal to the RESULT block to show the future outcome.
- Clean Code: "If I add extra chili to the recipe, it will be perfectly spicy."
10. (Corporate - Bug Fix): * The Bug: was
- The Logic: Sandbox Override! The director is not actually here.
- Clean Code: "If the IT director were here, he would sign off on the security patch."
11. (Casual - Level 2): * The Bug: don't have to, will whip up
- The Logic: The reality is she does have to teach Python. She is imagining a fake reality where she doesn't. This requires Level 2.
- Clean Code: "If I didn't have to teach Python this weekend, I would whip up a massive dinner."
12. (Corporate - Level 3): * The Bug: didn't fail, didn't lose
- The Logic: Post-Mortem of a past event. Requires Level 3 (Past Perfect + Would have).
- Clean Code: "If the backup server had not failed, we would not have lost the client's data."
13. (Casual - Bug Fix): * The Bug: drop by
- The Logic: The IF block is correct (Present Simple), but the RESULT block needs a future Modal to show the projected action.
- Clean Code: "I will drop by your office tomorrow if I finish my freelance work early."
14. (Corporate - Level 1): * The Bug: will roll back
- The Logic: Double Future Crash.
- Clean Code: "If we roll back the update now, the users will not experience any downtime."
15. (Corporate - Level 2): * The Bug: was, will sign off
- The Logic: Sandbox Override for the fake reality, plus "would" for the hypothetical output.
- Clean Code: "If I were the lead architect, I would sign off on this API immediately."
16. (Casual - Level 0): * The Bug: are soaking, are tasting
- The Logic: This is a cooking fact/constant. It requires pure Present Simple (V1/V5).
- Clean Code: "If you soak oats overnight, they taste much better the next day."
17. (Corporate - Bug Fix): * The Bug: roll back
- The Logic: The RESULT block ("would not have lost") is correctly formatted for a Level 3 Post-Mortem, but the IF block trigger is stuck in the present tense.
- Clean Code: "We would not have lost the files if we had rolled back the system yesterday."
18. (Casual - Level 3): * The Bug: didn't hold off, would go
- The Logic: The concert was last night. This is a Level 3 Post-Mortem.
- Clean Code: "If we had not held off on buying the tickets, we would have gone to the concert last night."
19. (Corporate - Level 1): * The Bug: we buy
- The Logic: The IF block is correct, but the RESULT block needs the future Modal.
- Clean Code: "If the manager signs off on the budget, we will buy the Lenovo workstation."
20. (Corporate/Casual - Full Refactor): * The Bug: was not, will have to
- The Logic: The speaker is a freelancer. Imagining they are not is a Level 2 Sandbox scenario requiring the Override.
- Clean Code: "If I were not a freelancer, I would have to ask a boss to sign off on my vacation days. I am glad I can just hold off on taking projects when I want a break."
Part 5: Advanced System Interaction (Passive Conditionals)
21. (Corporate - Level 1 Passive): * The Bug: will be signed off on (Double Future), will push (Active Voice instead of Passive)
- The Logic: Fix the IF block to Present Passive (
are + V3). Fix the RESULT block to Future Passive (will be + V3). - Clean Code: "If the wireframes are signed off on tomorrow, the new UI will be pushed to production."
22. (Corporate - Level 2 Passive Sandbox): * The Bug: was hacked (Sandbox Override missed), would roll back (Needs to be passive to match the object focus)
- The Logic: Apply "were" for the hypothetical passive trigger. Apply "would be + V3" for the passive output.
- Clean Code: "If the main server were hacked, the database would be rolled back to yesterday's backup."
23. (Corporate - Level 3 Passive Post-Mortem): * The Bug: had tested (Active), would not have held off on (Active)
- The Logic: The code did not test itself. The deployment did not hold itself off. Both blocks must be fully compiled into the Passive Voice.
- Clean Code: "If the code had been tested properly, the deployment would not have been held off on."
24. (Casual - Level 1 Passive): * The Bug: will not hold off (Active)
- The Logic: The movie does not hold itself off; it is held off by people.
- Clean Code: "If dinner is whipped up quickly, the movie will not be held off."
25. (Corporate - Level 2 Passive): * The Bug: was escalated (Sandbox Override missed), would approve (Active)
- The Logic: Apply the Sandbox Override to the passive trigger. Shift the result to passive because the budget cannot approve itself.
- Clean Code: "If the issue were escalated to the CEO, the new budget would be approved immediately."