Do you think that this advice also applies to writing software?
I think it applies to most intellectual endeavours. Especially the part about working early in the morning, when your mind is still uncluttered with bits of information, like news, conversation, etc. Your focus is greatest then.