(8 answers) Take me to the question
- Understand the conditions that get you into the zone; and maximise the opportunity for those conditions to occur. eg. most devs I know need to organise their week to ensure they have big chunks of meeting-free time. Most need quiet and/or the right music. etc
- Understand the law of diminishing returns: very long hours don't work. There's a point where you are just writing absolute junk that you'll just have to refactor tomorrow.
- Time box debugging. If you've been staring at the same problem for two hours, go for a walk outside for a few minutes. If you've been staring at the same problem for a whole day, talk it through with a team mate.
- Make sure you understand why you're building something, not just the blunt what. Know what the company's strategy is, know what your team goals are, then you'll understand where your contribution fits in.
- Invest in ergonomics. Get a great chair, ergonomic keyboard, etc... whatever works for you.
- Have at least one non-coding hobby.
- Do some kind of exercise.
- When you take holidays, take holidays. No work email or chat, take a break from coding, let yourself decompress. Otherwise you're just spending your leave days for no reason and won't be fresh and ready when you officially go back.