Ask HN: How do you code while dealing with personal problems?
I had some personal problems this weekend and it's been on my mind all morning to the point where I can't concentrate at work.
Unless it were some urgent bug fix, I find coding to be extremely hard for me as my mind is always wandering.
Any advice?
21 comments
[ 2.6 ms ] story [ 55.3 ms ] threadAt my company, I switched over to our new stack (all ReactJS) at the end of last year and then had a whole bunch of personal/family drama hit me right after. It was so overwhelming I had to ask my supervisor to move me back to our old (Ruby) stack. I'm grateful he did. Not having to suddenly learn 10 new technologies at once gave me back the mental space I needed to deal with the other stuff.
I find myself more energized getting straight to work after a run.
Hope you work it out
1) first, grab a real pen(cil) and paper (even if it's scrap), sit down somewhere comfortable, and take some time to write down what's bothering you. How it makes you feel, and why, and what you want to do about it, and everything that's been running through your mind about it. Until you have no more to say. This helps your mind feel like you have given the problem the attention it deserves.
2) write down 2-3 finite, specific tasks that are important for you to get done today, and that you know that on an ordinary day you can complete all of in just half a day. This is a point of focus for your workday. Even if you accomplish nothing else, completing these tasks should be considered a victory on a bad day.
3) take a walk or meditate for 15 minutes to clear your head and refocus. Don't beat yourself up if your mind wanders or even returns to what's bothering you, but if you can empty your head, do. The purpose of this time is to create a mental break between the thinking about this problem and thinking about work.
4) don't force yourself to start coding. Do force yourself to open up your text editor to the place you need to be to get the first of your 2-3 tasks done.
5) if, at this point, you're still unable to code, take a mental health day or two. Focus on taking care of yourself, because you'll be more productive tomorrow if you heal yourself today.
The older I get, the more I realise the most important thing we owe ourselves and each other is greater self awareness, and this tool/process is invaluable in achieving that. At the very least, will give you the clarity needed for coding.
I am going to take a small break now to mindfully approach all the problems and think of what I can do to solve them today. If there's nothing I can do today, I can at least know that I did whatever I could for now and can move on from the thoughts temporarily.
Listening to music which you usually listen to while programming can put you back in the zone, if the problem is not too serious or not too distracting.
For suggestions, it's going to depend on what type of problem it is.
For a short term (or not overly personal) problem, like extended family issues or similar, take day off and either:
* Sort out the issue (if you can)
* Relax - just taking a day for yourself and doing what you feel like doing (even if it's lying in front of the TV all day) can do wonders for your mental state
Like another poster pointed out, the issue can be more productively dealt with or processed with a dedicated day, rather than trying to do it inbetween work commitments.
For longer term issues (serious illness in immediate family, relationship problems, etc), there is no surefire way to deal with it, but there are ways to make it impact your work less (note: it WILL impact your work - the goal is to make that impact as minimal as possible). Keep in mind that your health and mental health impacts your ability to work and provide for yourself (and family). Protect this at all costs, and remember that family responsibilities should come first (any reasonable employer will understand this to some degree).
Some things that worked for me:
* Inform a superior that you trust about the issue. Tell them that you will do your best to minimise impact on work, but it's important that someone knows you're not just 'slacking off', but dealing with problems. Ideally, this is someone that will have your back.
* Talk to someone, be it a friend, professional, family member, etc. Talking to someone helps you process the issue quicker, and takes some of the worry off your shoulders.
* If you have elements of your job that involves close interaction with other people, do those. Interacting with another human (with the knowledge that you can't let them down while working with them) is a quick way to focus, and also has room for lighthearted interaction, or deep technical discussion with someone to take your mind off things.
* Focus (in the short term) on things that you're good at, and can do almost 'mechanically'. If you're good at coding, but hate documentation, do the coding. If your superior knows what's going on, they'll understand.
* Find things that are mechanical to do - if you need to test things, and there are test plans and procedures in place that you can follow systematically without too much thinking involved, do those.
* Meetings. Everyone jokes about them, but they are good in this case (unless you have to prepare/present them).
* Lower your expectations for daily output, so that you are not disappointed at the end of a day. Do, however, try and absolutely stick to these lowered expectations. Start small with tasks, and once you're in the groove, keep running with it. Try your best to not overthink things - break them down into small, manageable chunks.
* Try and avoid unnecessary interruptions when you're in the zone, because at this moment, it will take you much longer to get back in the zone.
* Try and avoid things that will remind you of the issue while at work - deal with them after or before work. Do not check personal e-mails, etc. Obviously this is not applicable in all scenarios, but helps for things that you can't do much about short term.
* If it all gets too much, take a day off, and relax. A 'mental health day' can buy you another month work of mostly productive work days.
I hope this helps!
- take some time off
- work out
- do free expression exercises
- meditate
http://www.simplehabit.com/