Design Patterns · Junior · Question 74 of 75
What does the Principle of Least Astonishment say?
- ✓Correct answer: Code and interfaces should behave the way users and readers most likely expect
- 2Avoid any surprises by writing no comments
- 3Users should never see errors
Explanation
A function getUser() shouldn't also send emails; a "Cancel" button shouldn't save. Surprises cause bugs.