Multiple ChoiceBeginner 45s
Rule of three
What does the 'rule of three' suggest about when to abstract duplicated code?
Options
- 1Abstract the shared code on the very first occurrence to avoid any duplication at all costs
- 2Wait until the same pattern appears a third time before extracting an abstraction
- 3Never abstract duplicated code under any circumstances, tolerating unlimited copy-paste instead
- 4Only extract an abstraction when the duplicated code is identical character-for-character everywhere
Think you can answer under pressure?
Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.