DEV Community

loading...

Discussion on: 5 Programming Patterns I Like

Collapse
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.

Collapse
booradley profile image
boo radley

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