Or you can zone an area where both commercial and residential development are permitted. Sure, living right next to a metal shop or something isn't the most pleasant thing, but it's really nice if you work at that metal shop.
This is something I saw being developed in my home town before I moved away. Along the main "downtown" strip they built several new 2 story structures where the bottom floors were shops like whole foods and such. On the top floor were various types of apartments. These particular apartments were a bit on the expensive side mostly due to it being a kind of swanky neighborhood right along the beach. That said, the concept can be expanded upon to apply to more affordable areas.
http://urbankchoze.blogspot.com/2014/04/japanese-zoning.html
Interestingly in the mission bay area there's a lot of unused commercial first floor space below residential apartment buildings. Some of it empty since the buildings went up 2012/2013.
Why do you think that is?