Here in the UK, affordable housing provision (10% nationally, higher in some areas) is a pretty standard policy. Generally speaking, it seems to work well, although sometimes developers can buy their way out of it by providing a contribution ("section 106") to the council towards building affordable housing elsewhere. And in a few cases there has been controversy around "poor doors", with the developer providing different entrances to affordable units so that well-heeled residents don't have to brush shoulders with the unwashed masses.