Scaffolding is a temporary structure used by workers to build or repair a permanent structure. Scaffolding goes up, the building gets built, the scaffolding comes down.
In software development scaffolding is code and tools that you create to help you as you develop, that are also destroyed in the development process. Incremental refactoring steps are scaffolding. So are no-op interface implementations, dirty shell scripts used to glue things together, and ideas that fail.
They are ephemeral ways to build software. They may live forever in your source control, but you’ll only use them for a short time.
This makes scaffolds different from tests. Tests not only help you build software; they increase in value as they age. Tests are support beams inside your application.
Throw away work is when your software works correctly, but it never gets used. Features that get built and never get used are throw away work. Throw away work doesn’t create new opportunities, it often exists as a software crutch for uncomfortable decisions. It rarely serves a purpose and never provides value.
The biggest difference between scaffolding and throw away work is how it makes you feel. Scaffolding should be energizing and opens new horizons. Tests give you confidence. Throw away work leads you to a dead end.
When in doubt ask yourself how long the code is supposed to last and what it would take for it to be a success.