I know that I'll sit here doing nothing on the Internet when I'm not constructive yet the hours still fly on by. Realistically, I should realise when things won't get better, get up, go for a walk or play with my son. On the off chance I've done this in the past, I always feel more refreshed and can turn a previously crappy day into something positive.
But sitting on your chair, punishing yourself because you don't know what to do/code, isn't very effective in bettering yourself.
I hope that's what OPs point was. :)