Most of us get compensated to do it and the hardware either paid for or tax deductible. Whatever positions you take as a developer, there is strong end-user demand for software on iOS and to a certain extent macOS so there will continue to be people who'll do that dance.