My answer is this: if you can't monetize your effort without hiding your code, then you just don't have enough skill to do so. Ever tried creating something that people will be glad to pay to see it improve and grow, not the 100500th "app" that looks and feels the same as the previous 100499?
P.S. I stopped doing programming for a living in 2016 and feel much better since then.