It sounds like you're working from home doing contracting/consulting programming. If you find yourself unable to police yourself, admit that this type of job isn't for you and find a full-time job. I am the same kind of person. I have my work computer, with minimal distractions, and my home computer which is full of distractions. If you have both long-term and short-term goals in an office environment, it's much easier to focus on what you're supposed to be doing. Being in an office environment discourages you from straying off-task because you feel pressure to not do so. I've spent many hours doing independent contracting, but I realized early on that I couldn't be as productive as I could be when I was away from the distractions of home.