3 ms·
It depends on what you consider simple. I don't consider the earlier code simple, just crude. Testing it, or adding features (e.g., tacking caching) would incre
by hcarvalhoalves 13y ago
It depends on what you consider simple. I don't consider the earlier code simple, just crude. Testing it, or adding features (e.g., tacking caching) would increasingly make it messier, plus the code mixes error handling and low-level concerns with business logic.
The final result is broke up in nicely referentially transparent functions, making testing or refactoring more trivial. Also, the main body reads as a DSL, a programmer can pick this code and more easily figure out what it does, which is easier to reason about.