Developing persistance or the ability to continue to code

Hey guys,

I’ve recently finished my 2nd year as a CS student and during this summer I’ve tried to work hard on personal projects but I find that my depression is keeping me from reaching my full potential.

I’m lucky enough that my current employer (non-Programmer student assistant type role) allows me to work on programming during down time at the office. So I originally set out the following goals -

  1. Work on my project for 30-40 hours a week ( A web app)
  2. Take Coursera courses to fill some knowledge gaps (i.e. Algorithms)
  3. Start researching topics that are covered in next semester’s coursework, OpenGL, Software Engineering, etc.

Now that almost two months have passed, I am nowhere near as productive as I originally set out to be. I have completely failed to achieve goals 2 and 3. I’ve found that I’ve placed more effort into my project than the other primarily because I want to show employers a halfway-decent GitHub portfolio.

But my depression is holding me back from making any progress. I find that simple error messages or difficulty in thinking of a solution to a problem steers me away from working. I will work on my project for about an hour or two, hit a brickwall, and then quit. I am fearful that I can’t break out of this endless loop of bad work ethic.

I have established a healthier lifestyle. I exercise for an hour 4-6 times a week. I eat small healthy meals throughout the day. Despite all the positive changes to my lifestyle, I still feel depressed throughout most of my day.

My question is, how can I develop a level of persistence in which I can crank out code/solutions throughout the day? Is it a mental-health issue that is stopping me from becoming a good programmer?

TL;DR - Second year CS student unable to find the mental strength to work on code because of depression. Wondering how to develop a level of persistence/work ethic.

Thank you

Hi @cs_student
I’ve been in your position as a undergraduate myself, wanting to do it all. This is probably not what you want to hear, but I think you should seriously consider doing less. Or at least, consider not trying to do everything at the same time. Coding for 30-40 hours a week is mentally taxing as is, and adding the kind of studying you describe would be very difficult for anyone (not impossible perhaps, but definitely not easy). Personally I find it hard to do more than about 6 hours of very taxing mental work in the day. I can spend more hours doing more routine code-related tasks (documentation, cleanup, organizing my commits, writing status reports to my colleagues), but not on core tasks like designing algorithms.

Here are some concrete suggestions you could try:

  1. Try doing less, at least for a week or two. Don’t worry about doing the Coursera courses, or studying ahead. If your webapp is what’s most interesting right now, do that and don’t worry about the others.
  2. Measure output, not hours. Personally I find it better to measure my productivity in terms of things I’ve accomplished, rather than the number of hours I’ve put. I decide on a couple of important things I need to get done in a day (or week) and focus on getting them done. If that means, that a particular feature takes only an hour or two to implement, that’s great. I can call it a job well done and take the rest of the day off. Any other time I put in is purely optional and stress-free. Conversely, if it means I spend ten hours of a day and stay at work till 8pm, I do that too. In the long run, I’ve found things usually balance out into a reasonable amount of work, especially in the latter stages.
  3. Don’t feel guilty about taking time off. Reading your post, it seems like you’re beating yourself up over not working long hours. I don’t think that’s healthy. One thing that has really benefited me is really taking time off. When I’m at work, focusing at a problem, I’m totally focused. But once I’m away from the computer, I give myself permission to completely disconnect. I often have code-related problems rattling around my head, I don’t feel obligate to always be thinking about work. This plays into measuring output rather than hours. If I know I’ve met my goals, I can feel guilt-free about watching Netflix or hanging out.

The point of all the above is to develop a healthy and sustainable relationship with your work. Later in your post, you say you feel depressed despite working out and eating healthy. If that’s the case, I would strongly suggest you see a mental health professional. Problems of persistence/work ethic can be tied to depression in intricate and for lasting relief, you should really talk to someone professionally qualified to help you. I’ve been seeing a therapist for over a year now, and it’s been really helpful in teasing apart what aspects of my problems are simply dissatisfaction with my work and which ones are broader depression-related issues.

1 Like