Each of these is to some extent a judgement call-- but you can't judge if you don't know the fundamentals, right?
#1 Say all your variables have something in common, like ending in ".html". Is it better to keep the shared part in each separate variable, or to add it dynamically as you go along? ("If longer-blahblah = some codition" vs. "If shorter-blahblah . 'extra-bit' = some condition")
#2 When does it become cost-effective (cost = time, server resources etc) to pull your variables out of the code and stash them in an entirely separate database?
Short-term answer in my case: "When you are at least two orders of magnitude bigger." But I'm still curious. Does it make a difference if the database lives on a different server? (I just read the fine print for my specific host. Databases associated with a domain live in the same geographical location, but not necessarily on the same server. This may explain why piwik can be so excruciatingly slow at times.)
#3 You've got two or more include files-- say, different ones for different directories, and then some things that are shared across more than one directory. Is it better to keep them parallel (Include A and Z, Include B and Z, Include C and Z) or nest them (Include A, B or C, each of which in turn includes Z)?