I generally get bored while writing couple of codes. I am unable to concentrate. I have deactivated my all social network accounts b/c I thought it will help me to stay motivated and focused. But it didn't help me.<p>I would love to know what things you do to stay motivated?
Focus on discipline over motivation.<p>Here's a quote from Jim Wendler (5/3/1 workout program) I like quite a bit<p>"Discipline always trumps motivation. Motivation is about emotion and too many times, we rely on emotion to raise our performance. Unfortunately, this can quickly wear you down and if you aren't motivated, lead to lackluster or missed training sessions.<p>Discipline doesn't care how you feel, what the weather is or if you've had a bad day. Discipline will carry the strong. Discipline will drive success. Discipline doesn't need a "hype" video or loud music."<p>If you are having trouble, start small. I got into the habit of making my bed every single day before anything else. Once I built that habit I started applying that to other things, and now I hardly think about it at all.<p>Take the emotion out of getting stuff done. Also keep hydrated and well rested. It's amazing what proper sleep and being hydrated will do for focus.
I can occasionally procrastinate heavily.<p>I will procrastinate when what I need to do is hard (requires too much effort), when it is too easy, or when there is too much uncertainty involved (worst out of the three).<p>So personally instead of trying to combat the symptoms with techniques like forced breaks or powering through any urge to do something else, I try to address the causes by taking up appropriate tasks or breaking them down sufficiently.
By doing 1 task at a time until it's finished.<p>And only doing tasks which are planned with visibility, which give them meaning to myself or someone else.<p>Otherwise you are just playing around and may as well be playing the piano or working on your tan, or learning a new framework (some hobby, pick one that applies).
I recommend prioritizing mental health over productivity. Give yourself time to figure out your problems when possible. Take a lunch break outside the office if you're allowed. Sleep for 9 hours when you can. Be nice to others when they're struggling. You're always going to get unmotivated sometimes, just try again the next day.
Take a break every hour and walk around.<p>Have a snack and drink, possibly with caffeine.<p>Clean your desk and keyboard to within an inch of its life.<p>Work on your sleep hygiene and general health.
How many hours hours of programming can you do? For me, it's aroud 4 hours (sometimes 6). Programming is hard and needs a huge amount of concentration.