TIL (Today I Learned) - Programmatic programming #5
Today's 3 Line Summary Try to decoupling between codes If you need to use external golbal data or static configuration wrap an API Try to write code around events TIL (Today I Learned) date 2022.03.26 The scope I read today Chapter 5 Bend, or Break What you want to remember in the book Topic 28. Decoupling Tell, Don’t Ask https://martinfowler.com/bliki/TellDontAsk.html Try not to have more than one “.” when you access something. There’s a big exception to the one-dot rule: the rule doesn’t apply if the things you’re chaining are really, really unlikely to change. Any mutable external resource is global data.the solution is to make sure you always wrap these resources behind code that you control. If It’s Important Enough to Be Global, Wrap It in an API Topic 29. Juggling the Real World But whatever their source, code that’s crafted around events can be more responsive and better decoupled than its more linear counterpart Top...