One Thing at a Time Vocabulary
Word Bank
| separation of concerns |
refactor |
data |
| display |
logic |
styling |
| extract |
module |
file structure |
| side effect |
|
|
Fill In the Blanks
- means each part of your code has one job.
- To means to reorganize code without changing what it does.
- The questions and answers in our quiz are the .
- The HTML structure and what the user sees is the .
- Scoring and answer checking are part of the .
- Colors, fonts, and layout are the .
- To means to pull code out into its own file or function.
- A is a self-contained piece of code that does one thing.
- How files and folders are organized is called the .
- A is when changing one part accidentally changes something else.
Quick Checks
- Match each file to its concern:
| File |
Concern |
questions.js |
|
styles.css |
|
script.js |
|
index.html |
|
- True or False:
- Refactoring changes how the app works:
- You should test after every change:
- It’s fine to change 5 things at once:
Stretch: Spot the Concern
Read this code and label each line with its concern (data, display, logic, or
styling):
var score = 0; // __________
scoreEl.textContent = "Score: " + score; // __________
if (answer === correct) { score++; } // __________
scoreEl.style.color = "green"; // __________