Test Driven Development seems like a big win for forcing individual
units of functionality to make sense, so let's talk about how TDD
encourages moving effects to the outside of the application by making
internal mutations difficult to test.
Trying to compensate for a slow API call by optimistically showing
success to the user makes for a great experience, but has some pitfalls.
Functional programming concepts can help.