Here in Los Angeles, granny flats are currently all the rage. The city has set aside a fund to help homeowners build second, accessory dwelling units (ADU's) in their backyard. As the name granny flats implies, the most common usage is to have people from the older generation live there, similar to your friend's duplex situation.
In reality, it seems as though most homeowners are renting these out long term or short term on airbnb, which doesn't really help the original goal of the city's fund which is to help mitigate our housing crisis (shortage).
There were some proposals that if you rent your back house out to section 8 (low income) tenants, you get all sorts of government rewards. I don't know if this program is working though, as it seems like a tough sell to convince homeowners to invite low income tenants into their backyards.