Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Programming is a highly cerebral job, and one of the biggest problems I have is bringing my work home with me. It's so easy to do: whenever I get the chance to think, my mind naturally wanders to work-related matters. I find so many of the other things in my day rather mentally unstimulating and as they say, nature abhors a vacuum. Unfortunately, constantly thinking about work is stressing me out and I can't seem to just flip that switch at the end of the day. It's been causing me quite a bit of insomnia.

To make matters worse, nearly all of my friends are co-workers, and many of our conversations do very little to make me forget about the week. They're fun people to be around generally, and once we've had our bitch-fest we all stop talking about work, but suffice it to say it does little to encourage me to forget about work-related matters.

So what can I do to leave my programming projects behind me at the end of the day? Or failing that, what type of mentally stimulating activities couuld I do to occupy my non-work hours with (that are non-stressful and don't involve mind-altering drugs)?

share|improve this question

closed as off topic by David Thornley, Yannis Rizos Feb 16 '12 at 1:42

Questions on Programmers Stack Exchange are expected to relate to software development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

24  
This isn't a programming question, this is a generic "how do I stop thinking about X", and the answer is simply to think about something else. –  JimN Aug 6 '11 at 3:15
1  
@JimN: stop thinking about purple elephants. Stop it right now. But seriously, no this isn't a problem specific to programmers, but it is one that most programmers face from time to time. Would you feel better if I said, "last night I suffered insomnia while obsessing over an optimal schema for a database with 40,000,000 rows, please help me!" –  Chris Aug 6 '11 at 3:48
3  
@Chris, chair-quality also "isn't a problem specific to programmers, but it is one that most programmers face" - but a question about chairs is still off-topic (as would be a question about insomnia). This question might have a lot of votes, but it's still off-topic, as per the FAQ. –  Cyclops Aug 7 '11 at 12:46
1  
@Cyclops: and if I asked a question about dealing with a difficult boss, would that be too generic / off topic? There are a lot of "gray area" questions on this site. Yes, this is one of them. –  Chris Aug 7 '11 at 16:30
10  
The FAQ isn't always correct, and isn't the bible. It's a really good guide, but even the FAQ admits that sometimes there are questions along these lines. Some bad-boss questions get closed because they are usually whiny or relevant only to the asker, whereas this question provides the opportunity to share experiences, which is almost entirely the point of this website. –  Jordan Aug 8 '11 at 5:05
show 4 more comments

17 Answers 17

up vote 72 down vote accepted

During my last project, I used to have the same problem. I was thinking about the code during my commutes to home, before going to sleep and even as I was alone in the room with my girlfriend.

That's when I knew I had to stop.
I have pretty much figured it out now, and here's my advice to you.

Get Positive

First, accept that you can't just stop thinking about the work out of the blue. This is a habit you have acquired, and habits don't disappear at your immediate will.

However you can start by reshaping your experience into a positive one.
Consider this example of negative thinking:

I don't know which database design is better. The deadline is coming next week and I feel I can't make the right decision at the moment. We can't afford to hesitate and If I fail now, I will be the one to blame.

This leads you nowhere.

It may sound trivial but if you suspect you don't work well enough, or worse, procrastinate, your conscience will revenge on you. It's five times as hard to think about work when you feel like you fail at it.

If you're in this kind of situation, there is something you can do about it right now.
Essentially, there are two points to add to your workflow:

  • Make sure you have something to be proud of every evening.
  • Make sure you have something you strive to work on every morning.

The ultimate goal of this is to switch your obsession to a positive tone. You know the feeling when you go to sleep thinking about that awesome code you wrote in just about three hours that solved all the world's problems and made the bunnies happy? You're still obsessed but now you've made a major and very important shift.

Get Productive

Once you're in the positive stream, you'll find it easier to effectively constrain your tasks to the working hours. Try to plan them in such way that thinking about the problems in your free time doesn't add any value. Consider this example of positive thinking:

This database design problem is an interesting challenge and I'll try my best to solve it. I know I'm usually more productive in the afternoon so I'll just have some tea now and fix a couple of bugs so I can give it my full attention when I'm at my best. Before leaving, I'll evaluate my results, and if I don't make a considerable progress, next morning I will ask for some advice from the more experienced colleagues and post a question on StackOverflow as well. I'll make the final decision by tomorrow evening.

What has changed? Now you pick your challenges and organize your working time in a way that makes sense to you. These eight hours are not just eight hours in your life, they are special, and you need to take advantage of them. Specifically, you need to:

  • Turn these eight hours into the Perfect Time™ for problem solving.
  • Make sure that physically being in the office empowers you.

The second point is a kind of trick you can play on yourself. Ask your company to provide you with the best hardware. Do you have three monitors yet? I keep my favorite teacup at work, and I just love my armchair. I'd never want to solve a problem without it again. Okay, I made up the armchair thingie but the point is:

If you learn how to get really productive at the office, you will see that the habit of bringing work home eventually fades because nothing really justifies it anymore.

Get a Life!

There is a great answer by pydave that does a better job of suggesting after-job activities.
You must check it out.

No, seriously.
Thinking about a database late night? How about going to a club instead? Watching a movie?
If you're not the type of person to know how to spend time, ask your friends to take you out.

I can't possibly remember how many times I was initially resistant to my friends calling me somewhere and then realized what a great time it had been and how I could've easily missed it out of the passivity. Now, even when work-related thoughts are buzzing in my head, if somebody calls me in my spare time, I just say “I'm in!” and get going.

A great relief comes when you realize you're still going to do what you love the next morning and there isn't a single reason to think about it right now. So go ahead and find something else to muse on!

Even when you're in love, after some time, you stop thinking about your significant other every single hour. This would have exhausted you. Instead, you split your free hours so there is a time for her (or him), there is a time for your friends and there is a time for you to be alone. There is absolutely no reason why you shouldn't apply the same principle to work.

Divide and conquer!

share|improve this answer
6  
Damn Dan, that is one hell of an answer. Bravo! –  Chris Aug 6 '11 at 16:35
1  
Thanks Chris! This is something that has been going around my head for weeks so I'm glad you gave me an opportunity to just sit and write this down. –  Dan Aug 6 '11 at 16:45
8  
+1: " if anyone calls me in my spare time, I say “I'm in” and get going " easiest way to start enjoying life, even though you will - initially - not want to go :) –  Binary Worrier Aug 6 '11 at 17:34
4  
@Binary: exactly, after several “false negatives” when things work out much better than you expected you just stop trusting this lazy I-don't-want feeling. –  Dan Aug 6 '11 at 17:36
show 4 more comments

Try taking up a hobby -- one that will completely engage you.

I'm thinking of something that takes a time commitment, and ideally involves other people.

share|improve this answer
37  
Competitive programming? ;) –  Chris Aug 6 '11 at 1:35
3  
+1 on this one. If you are able, find something unrelated to computers in general. What interests you? We all have that non-IT hobby. You just need to find it! –  user29981 Aug 6 '11 at 3:21
1  
@Tyanna: no it's rare because of... life. I have a girlfriend, a social life, and other responsibilities outside of work. Photography is a very involved activity for me (I like to go on 1 or 2-day treks) and I rarely have time to really enjoy it. The real problem is that I somehow manage to stress out about work related matters when I'm with other people (or trying to sleep). A hobby is a good idea, but for myself I think I need something that requires a bit less of a time commitment. –  Chris Aug 6 '11 at 4:45
1  
@Chris: You could bring a point-and-shoot or camera phone with you everywhere and try to regularly take photos that stress technical aspects. Find everyday situations where you can focus on composition. Make it part of your life instead of taking time out of your life for it. –  pydave Aug 6 '11 at 23:59
1  
Physically demanding hobbies are also good, because they force you to stop stressing out about work. They are also a great way to meet people, usually require little money, and help your overall health and productivity. For me, that hobby is biking. Although you may have different preferences, the most important thing is to find something you enjoy, and work it into your daily routine. (e.g. I usually bike to work, and on weekends when I have time) –  crazy2be Aug 7 '11 at 2:29
show 4 more comments

My wife and I bought a house about 3 years ago and it was cheap fixer-upper. Over the past three years I have been taking on projects and doing things that used to unnerve me and some things that some people told me that aren't worth the trouble.

Building, painting, cement patching, drywall, flooring, carpentry, metal working, and doing it all on your own time and at your own pace. It gets me away from the computer and coding and I take pride in the tangible results.

In a way I enjoy it because it can be mentally stimulating, but not to the point of mental exhaustion, I end up getting physically exhausted before that happens but I feel good afterwards.

Further I got pretty handy, I am more built than I was before and my wife likes the results (of the house too ^_-)

share|improve this answer
2  
I like this because one of the main reasons I'm so passionate about programming is the results at the end -- feeling like you've made something useful (and that you did it well). –  Chris Aug 6 '11 at 2:35
3  
+1 for "tangible results". –  Nick Wiggill Aug 6 '11 at 10:45
1  
Doing that myself...it's really great to do something that yields "physical" results after a day in front of the screen! ...and it gets you away from the television...! –  sbrattla Aug 6 '11 at 13:30
add comment

Dan's answer does a good job of covering how to reduce the urge to think about work. So let's talk about activities.

What kind of mentally stimulating activites do you occupy your non-work hours with?

Board Games

Many modern board games are social, mentally stimulating, and fun to play. Games like Ticket To Ride and Dominion have great strategy elements that will engage your brain and my (ungeeky and nontechnical) friends and family are always surprised how much they enjoy them. They're popular among programmers, so you may already have interested coworkers.

I'd recommend picking one up used (from craigslist, etc...) to give it a try. There's a stackexchange site if you have questions about what to get, but I'll give some basic recommendations. BoardGameGeek is a great site for reviews and understanding the game before you buy.

  • Ticket To Ride - Competitive game where you build transit lines between cities on a board. Simple turn system that prevents long boring turns. Despite being initially skeptical, my family members (aunts, uncles, and cousins) really enjoyed this game. It feels simple like Monopoly, but there's a great deal more strategy and the game comes to a great climax.
  • The Settlers of Catan - The classic starter game where you build up a settlement and barter with other players. Unlike Ticket To Ride, you directly interact with other players through bartering and can team up against each other. My nontechy sister really likes this game.
  • Dominion - It comes with a big box of cards and you play with a subset so each game can be different. Some will have no interaction with other players and others will be full of attacking others. It's essentially just a large deck of cards, so it travels well. My other less techy sister really likes this game.
  • Battlestar Galactica - This is not a beginner's game: The theme is geeky, the rulebook is quite long (for a board game), and a single game often takes hours. But it shows what board games can offer: it's a thematic experience that pits you against your fellow players and provides a great challenge that pits you against your friends. Battlestar Galactica will draw in fans of the show and plot knowledge adds to the game, but gives no advantage. You can work with the other players as a human or deceive them as a human-disguised robot. Human/robot designation is randomly chosen, so the game tests your guile and ability to exploit your friend's naivete.

Video Games

If you find movies not mentally stimulating enough, some games may give you what you want. Games like Portal, Half Life, Bioshock, Assassin's Creed, Uncharted, and Deadspace (there are many others, but I happened to play these recently) provide an interesting narrative, but require you to provide the action. (Some of those are playable on a powerful PC, but others require a game console.) There's lots of dumb action movie style games too, but I think they appeal more specifically to people already into games because they rely on continuous small rewards (like explosions, blood, and points) for your hand-eye coordination instead of creating a desire to progress the plot.

Many people can't handle moving an avatar with a controller and mapping what they see on their 2D TV to a 3D environment, so you could also try some 2D adventure games.

  • Various games from Telltale Games: Monkey Island, Back to the Future, Jurassic Park. These still have a 3D environment, but the movement for most/all of them is much simpler and can be played with a mouse.
  • Some classic adventure games are available as freeware on ScummVM like Beneath a Steel Sky and Flight of the Amazon Queen. They're easy to install on Linux (check your package manager). These classic games and others like Monkey Island can also be purchased in the Apple AppStore. Many of these older games have somewhat obscure puzzles, but the iOS versions have a great hint system built in.
  • There are also some modern 2D adventure games like Machinarium and Samorost.

For shorter nonnarrative experiences that also have simple controls, here are some interesting 2D puzzle games. Some of these games have a narrative, but the puzzle elements are more important.

  • World of Goo - Build bridges to solve puzzles. Great visual style. Only quick mouse skills required.
  • SpaceChem - Visual programming to create molecule factories.
  • Braid - A platforming game (like Mario) that provides puzzles based on warping time in various ways. Requires some hand-eye coordination, but mostly brain.

Programming

One of the most obvious ways to stop thinking about work is to think about an equally challenging, but completely unrelated programming problem. If just thinking about programming is causing you problems, then this might not help. But personal projects should be about improving your skills and having fun, so it shouldn't cause you anxiety. (You should be really worried if it does ;)

  • Try making something useful (a plugin for a tool you use).
  • Make something fun (a where's waldo game for your child/niece/cat).
  • Learn a new language.
  • Try making an Android app (the free SDK includes an emulator so you don't need a device).
  • Build a webapp.
  • Learn a new editor (and thus write a bunch of code to really understand it).
  • Research and answer long-unanswered Stack Overflow questions. : )

Learn Something New

Many universities offer their coursework online that are complete with lecture videos, slides, and assignments. If not to learn something, maybe discussion of "the rate of neurogenesis in animals" will help with your insomnia. (Maybe disengaging your brain from something that causes anxiety to something you're ambivalent about will help you sleep. I don't know anything about insomnia, but you could learn about that too.)

I'd recommend that you choose courses that won't make you think about work. You could try sciences that are completely new to you and unhelpful in your career. If that feels like a waste, Psychology or Economics may be applicable to work and still different enough that you can stay focused.

Literature

Read a book. Find some fiction that will keep you interested. I prefer Asimov and Clarke to best-selling dramas because the latter leave me depressed.

Write a story. Plan it out like software so you actually worry about the plot arcs for your characters and engage your brain. Participate in National Novel Writing Month.

share|improve this answer
1  
Wow, yet another awesome answer. Thank you. –  Chris Aug 7 '11 at 4:16
1  
I love your answer and thanks for the mention. –  Dan Aug 8 '11 at 19:39
1  
@pydave: I took some liberty to edit the answer, the first link specifically. It used to point to BoardGames as well :-) –  Dan Aug 8 '11 at 22:39
add comment

"How do you stop yourself from bringing work home?"

I lock my laptop in the desk drawer every day when I leave for home. I don't bother to learn to connect to the company via VPN. I didn't even bookmark the web interface for company email. My home computers all run Linux, so some of the development tools we use at work wouldn't even install on my home systems.

There are certain things you need to do to enable yourself to do work at home. Don't enable yourself. If you need to work late some time, stay late - don't bring it home.

This may sound extreme, but your time is exactly that. You can always bend your rules if the need arises.

share|improve this answer
1  
Actally I was referring to that tool between your ears -- the one that's already set up for work. –  Chris Aug 6 '11 at 2:10
4  
For some of us who work at smaller companies that can't afford application administrators we need to VPN in from home to do releases and troubleshoot from time to time. Apart from that I am a BIG supporter of "Leave work matters at work and home matters at home". –  maple_shaft Aug 6 '11 at 2:14
4  
+1 for running Linux at home while coding in Windows at work. That is the setup I have. –  Job Aug 6 '11 at 2:17
1  
+1 That worked for me as well. No VPN, no working from home, staying late at work sometimes when there's an emergency. –  Lukas Stejskal Aug 6 '11 at 10:12
2  
@Chris you will soon lose the will to think, if you can't code it right now. I think the approach phkahler suggests is a useful one, because it literally separates you from your work. you might think about the best DB design once or twice, but if you have to wait the entire evening AND night to actually implement it, you will soon cease thinking. trust me. –  Maggie Aug 9 '11 at 11:04
add comment

Make sure when you leave at the end of the day and especially the weekend, you have good notes, reminders for whatever needs to be done next. I tend to leave an 8:00 am reminder if there is something pressing. This is the start of peace of mind if you feel you are prepared.

Schedule non-work activities with people who will attempt to not bring up work. The more physical the better. Organize tasks that need to be done outside of work as well. If your work is detrimental to getting other things done, that's when it becomes a problem.

Don't feel like you have to go cold turkey. Sometimes I may take care of a work task an hour or two before bed. It's usually nothing too intense or possibly that one thing I can't get off my mind. You're never going to be perfect. Just don't let it dominate your life.

share|improve this answer
add comment

While you are punching out a couple hours by working overtime, you're severely hindering yourself from expanding and doing more in other areas of your life.

I'm a strong believer in working hard. And, to me, it looks like you're on the way to becoming extremely successful. I wouldn't want to be competing against you either way! That said, the premise sentence only holds true if your long-winded hours are not affecting you during the 'official' working hours. If you get to work the following morning and think "I'll just slack off for a bit since I worked a 12-hour day yesterday", then it's doing more trouble than its worth.

Also, remember that your out-of-work hours is where you should be spending your time socialising and building other parts of your life. Keeping an even balance in your lifestyle and striving to take things to the next level in every aspect of your life is one simple way for ensuring success.

share|improve this answer
1  
Oh trust me, life at work is fine and dandy. My managers are always impressed with my work. But I believe there has to be a healthy balance, and when my relationships suffer (or I'm too overstimulated to be useful at anything else) it makes me wonder, why am I still thinking about data structures at this ungodly hour? I'm beginning to believe that work should be left at work (if I'm going to have any hope of enjoying the other things in life). –  Chris Aug 6 '11 at 1:43
3  
@Chris: Please clone yourself; I'd love to hire your clone. –  Jonathan Khoo Aug 6 '11 at 1:44
show 1 more comment

I have several suggestions that seem like they would help me with this(as I am in the same boat as you). I haven't gotten around to implementing them in my own life yet because luckily/unfortunately my new job allows as much overtime as you want and pays time and a half for it, so I have been working even more than I normally would.

  1. Exercise. This always seems to help clear my head.
  2. Learn to play an instrument.
  3. Learn a new (non-programming) language.
  4. Start a personal programming project. Ok, this one won't help to keep you from thinking about programming, but at least when you do, you will be benefiting yourself, and not your employer. Be sure to check anything you signed when you started to make sure that your employer can't make a claim for your finished project.
share|improve this answer
2  
"you will be benefiting yourself, and not your employer" -- you will be benefitting both because working on a pet project makes you smarter and therefore more effective. –  Dan Aug 8 '11 at 19:46
show 2 more comments

This is gonna be a bit more personal, but the fact is, you are still very young Chris.

Now, I shouldn't be the one to talk since I'm turning 26 this year myself but I've found that this is an age/experience related thing. Younger people tend to be more energetic and this is why, when we're passionate about things we become absorbed by our work. This is not a bad thing but if you find yourself the need to distance yourself, it's gonna hinge on a lot of the things that have been suggested here already.

I stopped bringing work home with me not that long ago and I can only tell what has changed between then and now.

I was unhappy at my old job because there were all these things needed fix'in and I felt I was the only one doing a half decent job working towards that goal. Say what you will about the situation but I was not happy about the whole thing and I was pulling 80 hour weeks. This is obviously not sustainable and eventually I quit my job.

Now, I'm not telling you to quit your job, but evaluate your situation. Because at my current job, when I leave work, I'm satisfied. I don't feel that I have to keep working on stuff.

I've always has have a couple of hobbies, one of them is music. I also try to get some exercise every now and then (I chose to go out running, I used to go swimming). I read a lot of books. And this is what I do, when I don't spend time with people. I've always been like this, really! That I stopped bringing work home with me has changed rather recently.

I find that the most important thing here is to be satisfied with your work day. That way, you don't feel that you need to put in all those extra hours to deliver at the level of quality you've committed to. If it's change you need, I think it's really important that you change the right things, e.g. I don't think lowering your standards to feel that your doing good work is the right thing to do.

share|improve this answer
show 6 more comments

I had a talk with an experienced engineer a while ago. He said that he checked into a hotel once and said he was a musician when asked what was his profession. I think he also does some painting. Far from being excentric, this is a widespread behaviour.

The thing is with technical jobs you should find a way to turn off the switch and perhaps do something creative which is just as involving. It's my opinion that the human mind isn't designed for lengthy narrow and logical thinking. It's also a known fact that a non-negligeable proportion of people that end up in mental institutes were in technical jobs.

So a suggestion would be to take up an activity like painting, music, metal work, cheese making or whatever attracts you and with which you'd feel some sense of accomplishment.

share|improve this answer
add comment

I don't. I have breakthroughs when I am lying in bed in the morning ignoring my alarm clock. I am just trying to figure out how to bill people for them. Should I bill for the entire 8 hours of sleep? Or for the minute or so after I opened my eyes?

If you can stop thinking about work entirely when you leave it your work is not interesting enough, IMHO.

share|improve this answer
show 1 more comment

This sounds so familiar. I have the same 'problem'. You articulated it however much better than I would have done. First I thought it was not healthy to think of work during my free time. But I came to the conclusion and I think it is the same for you, that there will be allways something to think about. So when you can choose what to think about, when you think about your work it will be beneficial to your professional skills, which is a good thing.

That being said, I use social contacts, hobbies and my wife to take my mind of work/programming. Because only thinking about programming is a bit of a narrow mindset. For me sports, especially cycling help me to not think about anything. When I am cycling, after some time I enter the 'zone' in which I do not think about anything and just go. But YMMV.

So, although I think there is not much wrong in thinking about work, I would recommend a hobby.

share|improve this answer
add comment

My suggestions: Sports and music, maybe round it out with meditation. Look for a sport that you might enjoy and which would allow you to tire yourself out. I myself like running, but each to his own. Maybe a team sport suits you better, because you will not have as much time to reflect on yourself, but have to interact with the team.

But sports alone might not force your brain to shut out thoughts of work, so I suggest to play an instrument, because this will occupy your whole mind. Additionally you might try some meditation, but this might come hard to you if your mind is not calm enough allready, in that case you might try forms of meditation that entail some movements like tai chi.

share|improve this answer
1  
I loveeee Sports. –  surfasb Aug 6 '11 at 9:49
show 3 more comments

My work is also my play. Perhaps it's a bit mad really, and I do find the need to go and walk the Welsh countryside from time to time. But for the most part, designing and writing games is who I am, and I couldn't be happier than to be doing that with the vast majority of my time.

(My wife does help to get me out though :)

share|improve this answer
add comment

I was about to suggest you move to Colorado, but I see you're already there :-) My family has mostly been a SoCal family, and my sis got fed up with the rat race here, and moved her family to a suburb of Colorado - about 20 miles outside Denver I think.

The move isn't what changed her. The mindset was. Her profession is different - accounting. She was never a very athletic kind of person.

She just did her first tri-athlon this weekend.

She found something outside her profession that she could get excited about.

I'm in the same boat as you in a sense. I'm looking for something interesting outside of tech. I'm thinking a local meetup option for cooking might work for me.

Find an interest outside of tech... anything...

Greg

share|improve this answer
show 1 more comment

"Well.. I drink. But I didn't start till the 9th grade."

--Charlie Sheen

share|improve this answer
add comment

Between pleasure and addiction

No ready made response, it is your innermost problem.
As I am more than five Chinese buffalo, I crossed this situation.

You have to be able to say no, to the other, sometime, but to your ego, always.
No work at home : cut internet connection, write your ideas on paper, no more than ideas.
this evening, THIS EVENING, try this, a twelve hours world without computers.

do this ... or not, so you will know if you are able to have pleasure to go to work in morning,
or an addict which need help to understand how and why ego lure yourself.

HTH
Claude

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.