The first time though I wanted to move out before the other owner wanted to sell, so he stayed another 2 or 3 years and I was just a silent landlord, which was okay but made it impossible for me to get another mortgage or even a new credit card. In the end he got married and wanted to sell. This was in the DC area where the market was pretty much always hot, so selling the property was easy. Anywhere else it could have been more complicated.
The second time my friendship deteriorated over the course of the time I lived there because of external circumstances, in the end the other owner agreed to refinance and buy me out, and there was a little tension during the process but I think we both walked away satisfied with the outcome. One of the reasons our friendship deteriorated was because as we grew into adulthood, my friend chose a career in the service industry, and I chose a career as a teacher, and it sucked living with someone who had the opposite schedule. Over time as we settled into our lives, our social schedules diverged as well, which was definitely detrimental to our relationship.
I would actually recommend it either to people who are young and early in their adulthood, so that they have lots of flexibility and don't mind the challenges and inconveniences that it entails, or to people who are well settled in adulthood who already have similar lifestyles, employment situations, work schedules, etc. to minimize friction.
Doing it for 30 years sounds like my personal nightmare.
I could be remembering incorrectly here, but from memory this meant that in effect a mortgage would not be approved if each individual could not pay 100% alone. This limits the benefit of such an arrangement from "can't afford" to "prefer not to pay it all by myself".