So, I have 2 months before I go to finish my last year in CS. Every time I sit down to start a project, I will work on it for a few days, and immediately stop working on it.
How do you stay focused for these long projects? Or what are some techniques that you follow to keep at it for longer stretches?
I just enjoy coding. Some bits can be tedious, but for the most part I'm having fun when I'm coding, so it's not hard to stay focused. For the tedious bits I try to arrange my workday to avoid distractions so I can get started (that's the hardest part) and get into a 'flow' state where I won't notice that the work isn't all that interesting.
Like any long term endeavor you need to have manageable goals. Using a task management application will also help keep you focused on what needs to be done. Finally you want to be working on something that you're interested in.
I'm not much of a programmer. I'm working on an android app for personal use though and for me I treat it like a physics problem.
Break it down into smaller less daunting tasks learn how to do a small piece, practice that a bit, then play with it until I can incorporate it into my app. If I get bored with one part of it I switch gears and work on a different piece.
Breaking it into smaller pieces let's me have a lot of small accomplishments when I learn something new and incorporate it. The small accomplishments give me a good dopamine rush and keep me motivated.
This strategy makes a lot of sense.
When you get to a section of the program though that you know you are going to dread, whether it be something with the UI or something in the backend, do you knock off sections of it while working on other parts? Or do you try to get it out of the way as quick as possible? These parts for me tend to be the ones that kill a project.
I'm lucky that for me it's just a hobby so if I get burnt out I can take a break. I don't have deadlines to meet or anything like that. So what I do is usually just quit working on it until I get interested again or the state its in bugs me enough to fix it.
Again I'm not exactly a programmer though and if you do it for a living I suspect it's like anything else where you just suck it up and try to get through it until you get to go home.
Honestly? Friends. Just talking to them about it and hearing/seeing their reactions gives me the energy I need to get through the boring stuff so I can share the finished thing with them already!
Make satisfying completions. It's easy to do the motivating stuff, and sometimes if you look at it right, it's all motivating. If you're doing this project because you ultimately want the result, there's something in it that's making you work on it in the first place. Keep an eye on that. When it's done it's going to be awesome.
Some things just take discipline. Take little stretches to work on the un-fun stuff, because it's a way to get the awesome result that you want, but recognize too that not every step is going to be satisfying on its own. Sometimes, it's just work. That's okay. As long as you're reasonable with yourself and don't grind yourself to the point of getting unhappy, it's okay to work on stuff that's not fun every day. You're not just working on the UI; you're helping yourself build discipline, and it's not always fun in the moment. Discipline is a good skill to have and worth developing.