Writing some patchy code for some personal project is one thing. But publishing well structured and documented code to the world as an usable package is another thing.<p>People who do that on a regular basis, what made you capable or confident enough that you can trust your own code to run on other people's machines without the fear of failure?<p>Was it some specific topic in CS or something that gave you that confidence boost? e.g: some people say I gained confidence after taking an OS course or a Compilers course. Is it like that or is it by reading other people's code?
Why would you fear 'failure' putting up code for people to look at (and maybe run) for free in case it helps them? (Put a good MIT/BSD/Apache/etc licence on your code and you are not legally liable for anything idiotic they do with it.)<p>Are you worried about being laughed at? Being embarrassed at some future interview/meeting? If you do stuff for the right reasons (and follow the law, etc) then anyone laughing at you is someone you don't want to work with.
Publishing some less than perfect code doesn't mean failure. No one writes perfect code. All code has bugs and fails, and all code will offend someone's ideas of the "right" way to do it or how your code should look or whatever. Ignore that, do your best, accept criticism and feedback. If you publish code that someone else finds useful in any way you haven't failed.
I literally have nothing to lose by publishing. If people don't like it for the most part they just ignore it. You only need to worry about being shamed for your code if you get popular. In which case, there are plenty of other reasons to be proud about it.
Most open-source code isn't well-structured or documented. Some, including some popular projects, are downright terrible. But if it's useful to someone, there's benefit in releasing it.