by stingraycharles · 5y ago · 0 comments
Now, if you have a large system and many more of these “type keys”, by all means, this is an appropriate solution. But in the example of user type / creation, I beg to differ: the earlier example is much simpler to understand and reason about.
Imagine you are trying to debug an issue with user creation.
In the last example, you would have to look up everywhere `createUser` is being called, and follow the code path through several different scattered files until you find your issue.
In the original code, you can simply look up `createUser` and you have the complete code flow in front of you.