If you just do things for your own enjoyment, then it’s obviously better to do it semi-publicly so that you can connect with other like-minded people or simply give online passers-by something neat to look at.
Plus, if you’re motivated by the activity and not the outcome, you don’t have to worry about competitors at all because you have no competitors.
I am working in an industry where if one competitor would go open source and created decent open application, whole industry will effectively implode because end customers will always choose cheaper solution, which in case of open source would be for free.