I'm fairly new to coding in general. Only done about 2/3 serious projects. The problem I'm currently facing is that my code has too many bugs. After I have a working version of a script, making a change breaks something else in the code, and fixing one bug causes another to be produced somewhere else in the code. You get the idea.
I'm just wondering, what coding techniques do you all use to write less buggy and more manageable code? I'd like to hear how you make less mistakes in the first place instead of spending more time trying to find and correct them. Also, after you have an alpha version of the script ready, which methods do you use to test it, to make sure its working perfectly before submitting it to the clients for review / releasing it?
I'm looking forward to hearing your opinions on this