I'm thinking now that it depends on who you are.
If you're a developer, then you have an idea of the site you want to create, so you'll probably develop a website first and then try to monetise it by finding the right affiliate program.
If you're a domainer, you want to get the best return on your investment, so you'll find an affiliate first and then try to build a site that will bring in converting traffic for that specific affiliate program.