So you've started writing your first program -- great stuff! Here are a few tips and traps to watch out for along the way.
Long periods of time when your program doesn't compile and/or run at all
You enthusiastically start work on some big changes (e.g. re-architecting your application), but stop because you hit a brick wall, or don't have the time to finish it. The source code is left in a crippled and unfinished state. You can't do anything with any of your code until this is fixed, and the longer you leave it, the more you'll forget and the harder it will be to get started again.
In Continuous Integration this is called a broken build, and is a big no-no because it impacts other peoples ability to work. Without the pressure of a team environment pushing you forward, having a roadblock like this in your path makes it very easy to lose faith and motivation.
Make massive changes on a whim without revision control or a backup
There's nothing worse than changing your mind about the design of something after you've already thrown away the old one. When you do something that involves changing or deleting existing code, be sure to make some sort of backup in case things don't work out.
If you haven't taken the plunge with revision control yet, I highly recommend looking at some of the free SVN or GIT hosting services out there e.g. GitHub or BitBucket -- once you get into it, you'll never look back.
Ignore the YAGNI principle and focus on the fun/easy bits
Focusing on things like validation, eye candy or even general purpose 'utility' functions is a great way to build up a large complex code base that doesn't do anything useful yet. Focus on the core functionality of your software first -- your main features should be complete before you start thinking about nice-to-haves.
Throw your code away and start from scratch
As Netscape famously discovered a few years ago, throwing away existing code to start afresh is almost never a good idea. Resist the urge and make a series of small, manageable code refactorings instead.
Start programming before you have a clear goal in mind
Instead of a command line tool, maybe my application would be better as a simple GUI application? Or, I was originally writing my homebrew game for my old Xbox360, but now that we've bought a Wii, I'll port it to that instead!
What are you actually trying to achieve? Spend some time with a pen and some paper coming up with a really clear vision of what you're trying to create -- e.g. screen mock-ups. If you don't know what you're writing from the start, the goal posts will keep moving as you change your mind, and you'll have no chance of finishing it.
Get carried away with project hype before you've actually got anything to show for yourself
Spending hours trying to think of the perfect name for your software, designing an icon, choosing the perfect open-source license and making a website won't get you any closer to having a working application. Get something up and running first, and worry about telling people about it later.
Start a million new features and don't finish any of them
Jumping from one idea to another without finishing anything is like spinning a car's wheels and not going anywhere. Make a list of features your program should have, and put them in order of most-to-least important. Work on them, one-at-a-time, in that order.