Level 1 · Apprentice0 XP
Rename until the code reads like a sentence, then split what does too much.
Step 1 / 6
ProblemYou open a file written six months ago, by you. It works, but you spend ten minutes working out what it does. The logic is fine. The names are the problem.
← → step
Before this: What clean code is, and why it pays
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Open a file you wrote more than a month ago. Find the worst-named function, rename it and its parameters, and replace one magic number with a named constant. Do not change behaviour.
2.Take a function longer than 30 lines and split it into a short top-level function that reads like a list of steps, plus named helpers.