I feel like I have to be in a very specific head space to write code. It’s like climbing a big hill but in my head. Sometimes it’s effortless and sometimes it’s a slog.
Are there any proven exercises or techniques I can adopt that are proven to boost my ability to focus and get in that clear headspace to write code?
Edit: adding some tips as I try to figure this out. Note: not scientifically proven (to my knowledge)
- Music. which type depends on the individual.
- Timing. Dead of night or early in the morning when the world is quiet. Not this isn’t a muscle you can flex at any time, you have to just capitalize on the right time.
- Long shower
- Caffeine
- Get out of the office/house go somewhere else (like a cafe)
- Take a walk
- Have a beer
- Write thoughts down in a notebook without any phones/laptop in sight and then jump to the laptop to implement
- Meditate
- Lift weights / exercise to work the demons out and quiet the mind