Commuting doesn't have to be by cars, nor should factories and warehouse should be prohibited out of hand from being located inside cities. It really depends.
Even then, it still makes sense to aggregate industrial concerns within a given area to benefit from colocation of related industrial facilities and make it easier to commute via public transit.
Farms on the other hand should be subsidized. This is also where cars usually makes the most sense.