Three-Tier Hoisting: default to local, earn each tier upward
Three-Tier Hoisting: default to local, earn each tier upward
prickles.org
A2 Three-Tier Hoisting · Prickles
One of the tenets from a software-craft site I've been building. The idea is to keep state and dependencies as local as you can, and only promote something to a wider scope (module, shared, then global) once it's actually used widely enough to earn it. Most of the 'shared' code I've had to untangle started local and got hoisted up a tier too early.