How to back up programs and settings

We cannot overstate the importance of backing up your precious, irreplaceable data. But what about your programs – and in particular those settings, preferences and tweaks you've painstakingly set up over the past few months or even years?