I make the call on each tile, individually, as I play the game. I don't generalize and say "always put farms on this, and always put trading posts on that". Early on, you'll mostly be putting farms on the sweet river and floodplain tiles. Because you need food more to grow your population in early-mid game. But there always comes a time when your cities are well grown and you have more need for gold, and then some of those river tiles can usually be used for high-output trading posts. It's all situational. If you've improved a lot of river tiles for food, then you notice later on that your civ isn't even using some of those and doesn't need all the food, then put posts up.