Check your ego at the door:You will be wrong, or at least less than optimal, so very often. There is rarely one right answer to any given problem and many will believe that theirs is the best answer. Sometimes they are right, and sometimes they are convincing. These two things are not mutually exclusive. Even instructors give bad advice. Even novices produce eloquent solutions. Evaluate all solutions on the merit of the solution regardless of source. Apply this doubly to yourself.
Don't fall in love with your code:That part that I mentioned about being totally on the wrong path: it happens. A lot. Get used to it. I read somewhere that you shouldn't fall in love with any of your code, and that is solid advice. You should rarely assume that you've found THE optimal solution to any given problem. Don't allow any work that you've done to block any work that you need to do. If something is making the next task difficult, it will probably make the task after that even more difficult. If something needs fixing, right now is the easiest time to fix it because when you build on that crooked brick the whole wall will lean. Taking down a wall is a whole lot harder than removing a single brick.
Learn the rhythm of learning:Progress when learning to program is anything but linear. You will have larval times when you consume gigantic amounts of information about programming or an individual sub topic. You will read book after book insatiably. You will write things that you didn't think you could ever wrap your head around. You will absorb new languages like a sponge. These times are so very enjoyable!
There are also plateaus where you don't feel like you are going anywhere. You may not feel like learning new things. Or you might try and nothing seems to click. Your confidence will sag and you'll feel like giving up. These times suck. The cause could be just a bug in your wetware, and taking a break and coming back to it is sometimes the best solution. This time a weekend away or more is needed instead of a coffee run. Other times you may be suffering from a confidence issue and you are moments from a solution. Learning to tell the difference is a matter of experience. Take it on faith that either way this is temporary and you are about to hit the next phase:
Breakthrough! This is the moment when the dam breaks, the code compiles, the angels sing, the promotions come out...all of the above or something else entirely. This is the hit that keeps us coming back! Celebrate these times and cherish them for they are fleeting.