It wrecks the next day though, and can easily turn into an evil cycle - even more so now when having a family and there's no opportunity to sleep in to catch up.
The last thing you want to do is commit code at 02:00. Better to leave it to when you have a fresher head to review what you did beforehand, both for quality and perception reasons.
2nd EDIT: Having to be always online on Slack with all the @mentions pinging off constantly and/or just working in a busy and loud open office with meetings every few hours can be detrimental to being able to build up that mental model needed to see things clearly when tackling something new / that I'd like to get done in a better way. I'm probably not a fantastic dev, and showing my age, but I try to make up with persistence and enthusiasm for my work / field..