You can't "measure" a session musician either. And yet some of them take hundreds of dollars an hour to be there for a recording, so clearly there is a way to know
We are exposed to music so much that even someone who don't know how to play an instrument can tell the difference. So the average Joe can tell the difference in for example talent shows. Now imagine a talent show with programmers/developers, we kinda have that already with hackatons, but then it becomes more about the presentation, the actual code - if any code exist at all - is an absolute "hack".