I've been in software development for 38 years, and my favorite years have been spent doing Mac or iOS development (Mac in the 80's, and Mac or iOS for the past seven years). I write apps as a hobby, which helps keep my skills current, and my employer is (mostly) paying me to do what I enjoy; it doesn't get better than that.
To be honest, writing software for an employer can be a drag, because corporate decision-making processes can be frustrating. But I spent about 10 of those years with some degree or other of a management role, and those frustrations are even worse in middle management. I'm much happier as an "individual contributor". The upsides to corporate development are the benefits and reasonably steady paychecks.
Age discrimination? Maybe; I get along better with some people than others (and vice versa), and maybe age is a factor. I don't really hide my age (I like to inject "Get off my lawn!" into conversations every now and then), I don't try to pretend I'm someone I'm not. I think if you're doing what you like and are engaged as a team member, it all works out.
I think I still have about 5 more years in me, unless my plan/hope/dream of earning a modest income at independent development bears fruit before then.