I love coding but suddenly i started getting distracted and started losing interest.
Take a break and remind yourself why you want to do it. Or why you started. Visualize your goal. Visualize how you feel in the future and what possibilites you will have if you keep going.
That always works for me :) But we are all different.
I also wrote an article about coding motivation ;) hashnode.com/post/-why-you-should-keep-coding--cj…
Do like my friend did: Think coding sucks and then join the military for 8 years... Then come screaming back to coding after going to war.
Worked for him.
We've all been there. Figure why it happened.
Do not give up on coding though, it's a pirate's life for us. There will be good times and bad times, but the former will always trump the later.
Are you bored of coding, or are you bored with the work you're doing? Try to change languages, platforms, task types - hell, change companies!
Siddarthan Sarumathi Pandian he literally told me the story of how he was in college and he was assigned a project with 3 other people in assembly language. needless to say, it took the entire group all week to get the program running due to one bug, which was an off-by-one error somewhere. At that moment, he got so frustrated with computer science that he joined the Marine Corps after graduating. 8 years later, he's a combat vet and he's looking for a coding job. :) In fact, he's asked me to help him with low-level development.
Lennart Fischer
When I recognize that I loose interest in coding, I try to get in touch with other developers (for example in local meetup groups) to get new inspiration and motivation. It always helps me to get new ideas for (side) projects and motivates me to code.