Tip:
Here’s one that I knew to be good practice, but until today not exactly why:
Avoid string substitutions like $...$ or $(...)$ in macro definitions if possible (which may not always be the case).
Macros return unprocessed wikitext, i.e. constant strings. So they do not change even when their parameters do, and thus do not trigger refreshes. However, when using string substitutions, a change in the parameter changes the definition of the macro and results in corresponding refreshes. I hope I paraphrased that right.