3. Best Practices: Functions

Functions should be small and do one thing

Your functions should be small and do one thing with the minimal number of options possible.

If they have to be bulky and inelegant and have 4 modes and 5 options each, make it an internal API and make a bunch of small clean wrappers. Or, maybe you are sharing the wrong code and the real meat of your bulky function's body could be its own (likely internal, or private) function.