Q:

How to be more logical? (less bugs/errors)

I have been programming for 6 years and I am in high school (I prefer not to disclose my age). I have dabbled in many different languages. Just to list a few: Java, PHP, C++, Python, Autohotkey, Mathematica and many more. I have a very good understanding of the basics of general programming. The only problem is I still  create bugs all the time. I think too often. Do you have any hints besides continuing to program that will help me become a better programmer and make less errors?

A:

Keep your methods small. When methods grow too big, extract units of logic to new methods.
Name your classes, methods, and variables things that make sense. Never feel undue pressure to abbreviate any of these.
Use GoF design patterns whenever they make sense. [Here's a good beginner's book.]
Cover your code with automated unit tests. This will force you to modularize your code and give you confidence when refactoring.
Read Code Complete 2.

