There comes a point, somewhere late in the evening after my ADHD meds have worn off, where it's more productive to not do any coding. If I do, I'm just going to end up throwing most of it out tomorrow because it's a bunch of bug littered spaghetti.
Unfortunately, I also solve most of my big problems when I'm not staring at a screen. After which I have to resist the temptation to go work on it so I don't make a big mess.
It's some kind of cruel irony.
Then you set a bunch of reminders for yourself to remember the solution from yesterday. Then the next day you wonder what the hell any of the reminders mean
The point of the 4am code is to grasp a concept. You can clean it up later, but getting a firm grasp on what you want it to do is a solid dragon slaying win