Loading lesson…
Level 1 · Apprentice0 XP
Write comments that explain why, and handle failure without burying the logic.
Step 1 / 5
ProblemMost comments restate the line below them. They double the reading and rot the moment the code changes.
← → step
Before this: Side effects and pure functions
🛠️ 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.Write parseAge(text: String) that never throws: it returns a success with the age, or a failure that says why (empty, not a number, out of range 0..150). Use guard clauses.