It has been my experience that developing code in public leads to better engineering, better software, and better outcomes. You're less likely to cut corners when every aspect of your work is on display for the whole world to see. It enables people everywhere to learn, collaborate, and review each other's work. There are many other good reasons to prefer open source, which you should read about here.