Good point, I find it kind of unnatural to transform a developer community into a recruiting platform. I think it's just companies searching for a solution to solve the resume problem.
this is the kind of developer who will make sure his code is commented from the perspective of letting someone else see how it works, and that your internal dev wiki is well gardened. if you ignore the value this sort of person can add, it is entirely your loss.
Ultimately, I suppose that either are a good bet if you're looking for someone who stands out in a certain way. In both places you should vet the quality of the code or quality of the answers. And if you're the type of employer who uses these as metrics for rating candidates, then I think you should also probably give your employees time to work on their Github projects/SO profiles (I didn't intend the irony there, but it's there all the same).