A good balance can be open sourcing an internal library or two, so you get some of the benefit without the work needed to polish the mass of your core code.
With regard to recruitment, I think the openness is mostly a benefit to employees, because they can point directly at their work product like a portfolio. So it helps recruitment, but it's about them not about your cool problems.