r/learnprogramming • u/Ecstatic_Comfort_139 • 7h ago
Discussion How can I focus longer on programming?
I'm a creative person. I like creating things, and I would love to create my own apps and programs. However, I find it hard to concentrate on programming, and I found out that it's not something that I can just do whenever, for example, something like video editing. No, I have to fully concentrate on programming the whole way unless I have already learned something and I have to recall it.
I don't have ADHD. Could this be solved?
7
Upvotes
3
u/Beregolas 7h ago
This points to it just being "a skill issue", by which I don't mean to say you are bad... you just don't have enough practice to make it automatic yet. Writing and talking about your code makes you reason about it more, which helps you build mental models and makes thinking about it more automatic. If you program alone, this is often an issue. Basically try to explain it to learn more about it.
Also, in many ways programming is more taxing that video editing. It requires you to have more abstract knowledge in your head, to translate your ideas into text instead of visual ideas, and it requires you to think about multiple possibilities at once. I would call myself a pretty good programmer, I enjoy doing it and even with ADHD, I never had an issue to sit down and "just program", but it's definitely one of the most mentally taxing things I've ever done, especially on harder projects. I think the only thing that regularly was more mentally draining was playing Go (board game)
Many ADHD tips and tricks also just work for normal people. One that many neurotypical people find particularly helpful is: You are allowed to take breaks. Your code gets better when you take creative breaks. Anything that moves your body and doesn't occupy your brain counts. Go on a 15-30 min walk without music, without a podcast or audiobook. Nature is a bonus, if you can get it. Just think about whatever comes to mind, your programming project for example. Don't force it though. We often have far too many distracting background thoughts and tasks, aand since we are never bored anymore, they don't properly clear out.
General tips for better concentration apply: Nutrition, Sleep and sports. If you think you might lack in any of those, change it! It's worth it!
6
u/Professional-Owl1687 7h ago
Program something you enjoy
3
u/OtherwiseOne4107 6h ago
Proper sustained focus on something intellectually challenging is hard to do. It's normal. You are not deficient, you are using a complex organ in a way it's not used to, and that is tiring. It will get less tiring the more you practice.
When I was at uni, I had a physics tutor (who was a professor, the real deal), who said he could only focus on something challenging for 20 minutes. So he'd do 20 minutes, stop, do something less taxing, and then go again later.
2
u/dicewitch 6h ago
Have you tried the pomodoro method? Easier to focus 100% on one thing for 25 minutes and then take a break, vs half concentrate on it for "as long as possible"
1
u/funcyChaos 7h ago
It is difficult to solve. I either a) wait for a deadline and rush or b) wait for inspiration and ride the wave
1
u/spinwizard69 5h ago
Some people are really not built for programming, you may or may not be in that group.
However you may be on the wrong track here trying to focus longer on programming, I'd actually try to shorten the amount of time that you address programming each day. If not time focus on a concept each day. Once you grasp the concept get up and do something else. Do this 2-3 times a week, that is address a new concept. Then at the end of the week try to turn everything you have addressed into a program or extend a program you have built, using the new knowledge.
The idea is to address concepts in small steps then roll them into a real program.
1
u/mxldevs 4h ago
It sounds like you don't enjoy the process of learning something you're not interested in. Most people don't.
Programs are like assembled IKEA furniture: you have some idea what the finished product might look like, and you just have to figure out how to break it down into 100 different steps and do one step at a time until you reach the end.
1
u/LoneArcher96 3h ago
two days ago I was on my weekend, planning to continue one of my small projects, main problem was figuring out whether the current architecture of the app is good or if I need to redo it, the only problem is I was very drowsy, fired up vscode and just looked at it for hours, can't concentrate, I don't even know what I'm doing here, what is my task? I need a task like a function to implement or something, can't solve a problem I can't see.
some days or many days I would just be like that, it only started getting better when I opened up a notepad (or a pen and paper), and started typing away, randomly, about my current architecture, I have this class and I have that, and the concern I had before was this, and I kept typing until my flow kinda got going.
after an hour or something I didn't solve the question, but at last I had a clue on where to start, my achievement was literally putting a name and a description to the problem at hand, now I have a solid thing to work on, I can think about it.
Also this productive one hour session had a constraint, I told myself you get one hour, I don't care if you could actually achieve something in it or stared to the ceiling the whole time, once the hour ends there ain't no programming for you anymore (and I'm kinda passionate about it, this is important), constraints usually make me work more efficiently, given I could trick my mind into believing that it is contrained.
Hope this give you a clue. (and btw, I would kinda guess that I'm suffering from depression and burn out more so than ADHD, this might or might not give you some clues too)
1
u/kschang 1h ago
Pomodoro then. Periods of focus, take a break if you want.