Rules, Laws, and Gentle Guidelines
summary
Argues the Law of Demeter is a practical guideline not a rule, demonstrates with the paperboy wallet example and shows user_address vs shipping_address naming changes reduce coupling, recommends inject email_settings instead of delegating, and warns the guideline increases methods and arguments. Shows SRP is about “one reason to change,” not one tiny function, and gives a concrete failure: an internal gem replaced partial that is faster initially but breaks localization and HTML escaping later. Advises trade-offs, context, and avoiding unilateral late-night rewrites.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 0:48The Law of Demeter
- 4:31The Spirit of the Law
- 5:56Naming Matters
- 13:06Origins of SRB
- 13:34One Reason to Change
- 14:27Example
- 20:28Reasons
- 21:32Last principle
- 26:27Final thoughts
related talks
57mCore Software Design Principles for Programmers
51mOne Rule to Rule Them All
01h 28mLaw of Demeter: A Practical Guide to Loose Coupling
45mBeyond design patterns and principles - writing good OO code
50mOne Rule to Rule Them All
17mThe 5 developers’ principles that helped me as a new father
01h 03mTactical Design
32mRuby for Startups
