The difference between a well rested brain and a sleep deprived one is night and day.
The difference between a well rested brain and a sleep deprived one is night and day.
When I don't get 8-9 hours of sleep, I code exactly the way OP described. Things that normally take an hour, take a full day because I can't focus and miss the most embarrassing, basic stuff.
You need enough sleep, you need good sleep, and regular sleep.
And then you need down time. The time where you're not expected to rush to do something. Where you can sit down and learn a bunch, or pick yourself up and take a stroll.
You _need_ walks.
I'd add that it's worth spending some money on a decent mattress, great pillows, and tracking just how restful a sleep you're getting. The return on investment will exceed just improving speed of decision making.