The best programming decision I ever made was to simply stop doing it after a certain amount of hours, no matter of how 'in the zone' or 'on a roll' I thought I was. This has saved me many, many hours of having to redo all that stuff that, after a day or two, actually turned out to be terrible.