cottages help with taxes, as well as workers for your fields, and recruits for your barracks.

long-run, your going to get to lv 9 town halls, with 37 lv 9 fields. thats 16,650 labor force, which for an efficient 50% tax means you will want at least 8 cottages of lv 9. (and 12 cottages for the rebuild quest). past that, its just a question of more taxation which can be helpfull if you want to maintain more heroes.

early in the game, 12 cottages is a good number. later on, you will probably want to take a few out to make room for more barracks. 16 isnt that bad, but it is a bit more than you really need.

early on, you need at least 2 barracks- 1 for your higher tech stuff, and one to spam warriors. 5 or 6 barracks can be good for a still-growing city, allowing room for other things that you need as you grow.