The formula for success:
Write a code. Check and found bugs. Check and found bad big code. Rework code. Rewrite full system. Skill level up. Check code and found better implementation. Skill level up. Rewrite a code. Reduced 50% of lines of code. Skill level up. Looks good, but something stranged. Optimization of code. Skill level up. Good knowledge of server core. Drop old shitcode and write again with clear list. Skill level up. Looks perfect but something strange. Write again. Skill level up. Rewrite again. Skill level up. Done for sharing for private. Good reviewes about code. Skill and self-concept level up. Rewrite and optimisation of code. Sharing for all.
Now, you know how much need time and knowledge for write a perfect code. Now you starts to respect a job of other people.
And, the most important thing, you know how much it can cost.