DEV Community


Discussion on: 5 Programming Patterns I Like

assertnotnull profile image
Patrice Gauthier

Instead of switch to object literal I suggest the facade pattern. Going with facade pattern, your IDE will be able to resolve function definition. If this object resolution grows in complexity it will be harder to understand why this generic function refers to and only your debugger can help you.

booradley profile image
boo radley

The details of this would be an interesting topic for a follow-up article.