I've been trying to learn programming for several years, but the same pattern keeps happening: I get excited when I begin, enjoy watching tutorials, and then lose all motivation after a day or two. I've tried creating routines and removing distractions like my phone, but I still end up abandoning it. Sometimes I wonder whether this could be related to ADHD or another issue, or whether I'm simply lacking discipline. Has anyone dealt with this, and what helped you keep going?
5 Answers
Try treating programming as a practical activity instead of something you only study. Pick a tiny project you actually care about—a simple webpage, a small script, or a basic game—and focus on finishing it. Starting with something manageable gives you a concrete goal and makes the learning more engaging.
It is also worth asking whether programming itself is what you enjoy, or whether you mainly enjoy the idea of learning it and watching other people do it. Try different kinds of projects—automation, puzzles, websites, or games—to see what genuinely holds your interest.
Many people go through cycles of intense enthusiasm followed by burnout, especially when they set an overly ambitious pace. Build a sustainable habit with short sessions and realistic goals instead of expecting yourself to code all day. Consistency matters more than forcing yourself through long periods of study.
A routine can help, but motivation and discipline are not the only possible explanations. If this difficulty affects many parts of your life and you consistently struggle with attention or starting tasks, consider discussing it with a qualified healthcare professional. Avoid assuming that medication is the answer before getting a proper evaluation.
Make the first project extremely small, such as a command-line calculator or a simple hangman game. The important part is to write it and finish it, even if it is basic. Completing a few projects can build momentum much better than endlessly watching tutorials.

I’ve tried setting routines and removing distractions, but I still end up wandering off to do other things. I’ve wondered about ADHD because the pattern feels familiar, although I haven’t had a professional evaluation yet.