By the numbers I think only the best programmers, which is a small minority, should consider NIH. Everyone else should use off the shelf as much as possible.
Since the best software is written by the best programmers, those of us interested in the best software, and have the capability to make such software, should be free to do NIH on an as needed basis.
I think it depends on if the targeted application is essential to your companies core buisness/product.
As an example, say if you're a small cloud vendor, you should probably write your own machine OS imaging automation, but probably not your own chat client.