Why does it have to be one or the other?
If I've already got a couple good food resources in a city, cottages are prefered.
Otherwise, I'll need a few farms to get the city up and growing. Once it's big enough (nearing health and happy cap), build and work cottages. Maybe eventually cottage over the farms.
Of course it's always good to have a dedicated GP city in which you spam farms.
As with most things in civ, it's all about mixing it up and specializing cities to maximize the benefits of your multipliers.