This ignores different realities in how programmers and writers work.
If you're hiring a writer, you cam ask to see his previous work. Unless he worked for CIA, he can point to books he's written, articles he published etc. You can then read them and that's all you need to make a decision if he's competent enough (you might still interview for cultural fit).
If you're hiring a senior engineer that claims he spent last 5 years coding Big Table at Google, you have to take his word for it. It's not that you wouldn't like to see all his past checkins, you just can't in most cases.
Not being able to see past work, we do the next best thing: interviews, coding questions etc.
The simple explanation is: we don't hire programmers like writers because we can't, not because people hiring programmers are inexplicably so much more incompetent than people hiring writers (despite running much more profitable businesses).
This is changing a bit due to open-source in that more and more people are hired like writers i.e. based on their publicly available past work, but it'll never be the case that every programmer will be able to show his past code.