Sure he might not be a whiz with React like me or the OC, but... ¯\_(ツ)_/¯
With regard to him firing too many people, see my thoughts about what his mindset might be here[1].
But don't you think it's strange that (assuming so much of SpaceX's success is owed to Shotwell) nothing like what SpaceX has achieved was achieved at her previous gigs? But then she goes to work for Elon Musk and suddenly...
Regardless, the point I'm making is not "Elon Musk wrote all the software at his various companies himself" but rather "the idea that someone who has founded / run / exited a variety of companies in very diverse fields but all of which are good at software is a very strong indicator that Musk understands software".
Not to be dismissive of landing an orbital rocket, but that's mostly a feat of aerospace engineering and control theory. On the software engineering side of things for SpaceX I think their work around CFD would be the more impressive feat from a computer science perspective.
Elon just made sweeping changes that cratered their ad revenue and took an axe to engineering teams all over the company. He did this in the lead up to the holiday season which has been the most profitable part of the year with advertisers pouring a significant portion of their yearly ad budgets into ad buys. Even if he was 100% correct that all of this was bloat, it was a monumentally stupid idea to make these changes now of all times. I would have expected him to at least have enough of an understanding of software engineering to know that deprecating systems and cutting out bloat needs to happen carefully with the talent onhand to be able to back out changes and manage the transition seamlessly. Fundamentally the risks involved are more financially impactful than the price of keeping headcount around for another year to do it safely.
Twitter hasn't even had a major incident yet and just the revenue loss from advertisers pausing ad campaigns probably already offsets all the savings they were hoping for in 4 - 6 months once the layoffs finally start bringing down staff costs.
Another company he founded, SpaceX, is the first space launch provider to ever achieve propulsive landing and re-use of an orbital-class rocket, a feat which includes some of the hardest software engineering you can do.
Another company he runs, Tesla, is famous for being one of the few car companies that makes software for their cars that people actually want to use.
If a citation is needed, it is a citation to explain how anyone could possibly believe with that track record that Elon Musk doesn't know how software is built.