I know what you mean. And it’s quite a bitch. I’m so distracted easily whenever I’m writing something it’s ridiculous. Personally I found out that the best time to write something is late at night. I’m talking 1-2am or even later. Dunno why, but I’m three times more productive when writing something in the middle of the night. Obviously it’s also quite difficult for me to be writing something at that time, since I have to get up early nearly every day.
