I'm always saying "write the comments first." For me, I find it easiest to speak things out. So what happens is I speak out the logic, and then try and go stright to code. But since I don't type words much less code as fast I speak things out in my head, I get things messed up. So I always write the comments out first. I get them to make sense, then code to the comments...