Motivation is a tricky thing, it can come and go seemingly without any reason. You can't always control this - life happens. But there are certain steps you can take to loose motivation less frequently and to bounce back faster.
- Remind yourself why you are doing this painful thing.
- Like what you're working on:
- There are as many ways to be a developer as there are paths to get there. If what you're working on isn't helping your motivation, shake it up a little. Choose a different project or approach that still moves you forward.
- Lean on your community:
- If it's a friend next door or a chat buddy across the world, having someone to talk through your code or your struggles will make it easier to master that skill and move on. You each have different strengths. Learn to use your team-mates!
- Take a break!
- More often than not you can make everything better by calling it early and getting a good night's sleep. The next day your code and your motivation will be better than before.