One trend I see in the awesome developers I've met, is that they devote inordinate amounts of time to coding at the expense of (usually) their health. Personally, I also find it hard to motivate myself to keep healthy.
Every now and again, I meet a fantastic coder who has it clocked; they are up to date with the latest dev news, have time to read about good programming practices, and to finish it off, have happy wives/husbands and families.
How do you guys/gals manage it in the short 24 hours a day that we all have?
My only secret is to maximize the time I have available. Your time is incredibly scarce. Don't waste it playing with things. Get what you need, read the buzz, keep the sites like this to a minimum and spend your actual day at work writing the best quality code you can.
I have made it a priority to spend time with my wife and kids. You have to schedule it just like everything else. If you don't state it as a priority you will let it slip. "Just one more bug test" quickly turns into a very late night. Take the time off, go play with kids and wife - THEN look at the bug. The bug will be there, I promise. The wife and kids will be asleep by the time you have it solved.
Besides, there is a lot of research to suggest going and doing a totally different task (like play) can free your subconcious to solve the issue. Coming back at the problem later with fresh eyes will often reward you with something you were missing before.
That is the biggest difference between me now and 15 years ago. Back then I would spend entire weekends trying to solve some complex problem just because I could. Now I spend the time with my family and let the cool problems be solved in much shorter time frames, or by working with a group.
Yes, you can sometimes solve the problem much faster by sharing it with another coder. Even if they are just a sounding board, getting someone listen to you ramble can be helpful.
Get your priorities right. Code is one of those activities that will expand to take all the available time if you let it. Do the fun stuff (eat dessert first) and I then find it easier to work on the hard stuff.
This isn't really about being married as it is about time management. Being married is just providing you an excuse to, what might have been, poor time management before. The only difference is that, before, because you had no other responsibilities, you could goof off and not get much done and THEN get to programming and still accomplish a lot.
What you have to decide is what are you doing that is unimportant (are you spending an hour watching TV a night - is that worth it?), what is necessary (taking care of your wife and family is, in my opinion, more important as you made the decision to get married), and what you want to do (program/develop in your spare time). Say 'no' to those unimportant things, and then dish out your time to the others, respectively.
Everyone knows what you have to do to keep your life in balance: Eat healthy, sleep long enough, keep social contacts, don't work long hours, exercise... The trick is cheating yourself into actually doing these things.
Here are a few tricks which help me:
These are a few of the things that come to mind. I do all of these, and in my experience, they really help tremendously. Hope this helps!
All I can say is, just wait until you have children. ;)
Get a laptop, work as you watch movies or tv with your wife at night. Honestly having a wife, having kids, having anything shouldn't be an excuse for not being able to learn and develop yourself.
I finish work, I spend a few hours with my family, and then the kids go to bed and we have down time. During that down time I choose to program. Enjoy the time with your wife, don't feel like you should be working, but remember there is time after that.
If you love doing something you'll find the time. I have twins babies at home and I still actively learn and progress at a pace as fast as before.
I've always thought that people who say once you get married, or have kids, your life is over, is just an excuse. Of course it's all about them, but your life is not over. You can choose to stay where you are comfortably or you can choose to excel from there. The same applies to having a wife but it's even easier than having a wife + kids.
Is it hard? Yes, but the hard things in life are hard for a reason... so that not everyone does them.
I should also mention that communication is key in a relationship. If you feel troubled that you don't have the time to advance yourself, then talk to your wife. Work something out together.
Make a compromise with your wife: Tuesday and Thursday evenings and Saturday early mornings are for yourself: this could be programming, reading, etc.
Other days you will be completely there; not thinking of what you need/want to do on your latest project (at least that's the idea: I still think of what I want to do while commuting ;))
Another thing I wanted to add: set your priorities when you are working on your hobbies. Don't screw around reading blogs or forums unless they help you accomplish your goals.
Finding an employer who truly respects work/life balance was key for me. I recently changed jobs and am AMAZED at how much more flexibility I have.
Being able to turn your switch from programmer to family during your commute can be hard, but I tend to nail it most of the time. My long commute helps with that.
We refractor and optimize our lives when new lines of code/life is checked in.
If your job only provides you with an income and doesn't provide you with education or the chance to do things you feel are important, you will have a hard time finding fulfillment by squeezing things in at the end of the work day. So now you have learned what kind of job you want. Work towards achieving that. And since the best job, the most learning, and the most amazing contributions to a better world would be just ashes in your mouth if she and the dog weren't with you, make sure you find time for her while you're improving yourself and finding the path to that job.
Communicate, work with her, communicate, work through it.... I've been married and programming for 20 years. It can be done. If it's part of you you'll find a way to make it happen. Just keep your priorities in front of you. Way too many people put the ME before the WE in marriage. It says in scripture that the two become one flesh.
This one can go either way, but I find that working from home really helps me balance things. I can take lunch and spend it with my 2-year-old, spend the time I would be commuting making dinner instead, etc. Some people find it hurts their balance, since it becomes so much easier to work more hours instead, and it's definitely easier to goof off too, though, so it takes some discipline.
Finding an employer that really does respect your "off" time and allow you scheduling flexibility is also key, as others have noted. It's hard enough when you're not in a tug-of-war with your management.
I run my own small software company, and my major solution to the time issue was to build an office beside the house. No commute = more work time and more family time. Health wise, I try and get a run in most lunch times but it can be a challenge, and also try and play as much as possible with my kids outdoors. Kids love to play, and it can be great exercise for everyone involved. Having a young family, i.e. babies and toddlers, can be way more demanding than slightly older kids (mine are 5 and 9 now), so my advice to any one with the very young'uns is to go with the flow as things just keep getting better as they get older.
As I get older, I get much more jealous of own time, and the value I derive from it. I want to spend it with my wife and kids, or my friends, or even by myself, doing things I enjoy. For me, it's a matter of staying focussed enough to keep doing stuff I enjoying doing rather than vegetating when I'm not working. Healthy is also about keeping on having fun and enjoying life, smug as it may well sound. This takes effort.
I rediscovered my ADD (having had it pretty acutely as an adolescent) in my mid 30s. Learning about it as an adult, I uncovered the fact that context switching is just more expensive for someone with ADD. It explained the long nights solving obscure technical problems. Not because they were necessarily on my priority list, but because I didn't know how to stop. I was also less than confident in my ability to restore the mental context when I came back to my problem. I've since spent time developing my ability to context switch and various mental and external tools to maintain state. This allows me to balance more processes and get some decent satisfaction in my parenting, exercise, relationships, work, church, etc.
Get involved in some kind of exercise activity that is fun to do. For years I was a gym rat, but I found myself having a hard time going because it stopped being fun me me.
I picked up tennis again and it seemed to bring balance back into my life. I have been meetng new people an more importantly I spend hours exercising and it doesn't feel like I'm exercising.
Ultimately, finding something that you enjoy as much an writing code that doesn't seem like work seems to be the best way to go.
Beer...The cause of, and solution to, all of life's problems.
-- Homer Simpson
I often find exercise boring, as do many other programmers/developers.
To overcome this I subscribe to some good technical podcasts  and load them onto an mp3 player.
Now I find I have been able to walk for over an hour while getting up to date with latest technical/development topics. It just amazes me how the time flies and how healthy I feel after doing this.
If you have a wife/partner/kids, you can either walk with them and talk, or if you run out of things to say there is nothing wrong with both listening to podcasts/music. It's still exercise. http://stackoverflow.com/questions/1644/what-good-technology-podcasts-are-out-there#13284
If you're not in a crunch time on a project, then it's "just" a matter of discipline to get your priorities straighten out - family, recreation, etc... But our job can, and often is, merciless when it comes to deadlines.
I personally try (and made it thus far) to reserve weekends exclusively for non-programming activities. During the week, well, is entirely different matter.
I found this great quotation by Bruce Lee , which helps me create more time for the things I choose to make important:
"It's not the daily increase, but daily decrease.
Hack away at the unessential"
The last line equally applies to programming too ;o) http://en.wikipedia.org/wiki/Bruce_Lee
Sadly, time is scarce...
More sadly, people often forget how much scarce it is...
Saddest of all, there is always the choice to better use your time (and so much people do not understand/know this).
Your choices are your only way to "harvest back" time for yourself.
(Sorry now, I've to run away from my PC, the Grim Reaper is coming! :D)
a link  about social pressure to do more (vaguely related) http://www.lifehack.org/articles/productivity/why-just-do-it-just-doesnt-do-it-for-you.html
Use the time for travel. I spend over one hour in my car each day to get to work and back. Thats lot of of time. Since I can't read during driving audio podcasts are a very good alternative. They keep me informed about the latest things. There are a lot of free podcasts on almost any field of interest. Audio books are fine too if you like them.
I also sleep less. My working hours are very bad since I really work 9 to 5. But getting up at 6 give me the chance to get things done before I go to work since sometimes I am not in the mood when I come home from work. Sleep less but still sleep enough.
I good calender software and good GTD software can be very helpful. I sometimes forget things or events so a constant digital reminder is just what I need.
Don't forget your friends. Twitter and emails are find but people really should meet from time to time.
Make a "No computer day". Each week for one day don't touch your hardware. Not even reading emails. do something completely none-electronic. Meet friends, read a book.
Get up early, I am married with two children. After work I start my second job of raising my children. So the only time I can carve out is in the morning while they are sleeping.
For weight training/fitness:
The most important part of working out is consistency. When do you have consistent time of your own? Mine is my lunch break. I work out during lunch, there is a gym a quick walk from my office. I do weight training and do not take a shower afterwards to save time. Do I smell, no, because weight training does not get me drenched in sweat. Also, I walk to work, three miles a day, that is my cardio.
Personal Interest Time:
Like I said, I have kids, that means Dora is on TV rather than History Channel, or I am playing hop-scotch instead of reading. To find personal interest time, I listen to Podcasts on my way into work. There are a swath of technology and programming podcasts that are excellent.
And the most important, Date Night:
A guy who is married for thirty years taught me that date night with the wife (and without the kids) is essential for marriage. Keep the fire going and make sure you take out your wife. When she is happy, you are happy.
You will have loads of time leftover in the day.
Multitask. Previously, I got two or three things done on my one hour commute (via train, tram) to work: travel, personal programming, and perhaps listening to a podcast. Now I travel by bike, getting forty minutes of exercise in each direction and 'listening' to a podcast.
I feel your pain, and will advise that the loss of "self-time" only gets amplified when you start having kids.
You have to make adjustments as you transition from a bachelor-developer into a family-man. I find inspiration in other successful developers with wifes.
As far as your interests in self-educating and spending time working on side projects, just because you're married doesn't mean you have to give that up. Work it out with your wife that you need X hours every T-TH (or whatever day(s) work) to work on your own stuff.
I've found with my wife & kids that works best. And the time that I'm not scheduled to work/study, then I devote it entirely to them.
Side note: I'd suggest kicking the sleep deprevation right away, that's a bad hole to start digging.
I hope that helps...
It is a challenge.
Make the most of the time you have. I no longer have time to read up or try out the latest technologies, but I use travelling time on the train to read magazine articles, so I can find out which things I need to focus on.
I try to put my family first, work second, and health third. But I use technology to motivate me to keep fit- I wear a heart rate monitor and run with Nike+, so I can record all the details of my runs, log them on websites, and analyse them. The geek in me really responds to that, and I get fitter as a result.
I think as you get older, you have to accept you are no longer the hot shot developer you may have been- you have different priorities. And that is fine.
So my overall advice is to look at your life, work out your priorities, and devote whatever time is appropriate to them.
I live & work in Florida, so my "solution" to combating stress and staying healthy is to run or bike to/from work as often as I can. Not always easy to get things to/from work, so that adds some extra fun to the puzzle. For example, I might drive in one day w/ extra clothes, run home (w/ camelbak for hydro, phone & ext HD), bike in the next day and drive home with everything. rinse, repeat.
If you have the means, I would consider giving it a try. The amount of stress you burn off and moments of clarity you can have are extra benefits. I probably solve one problem a trip. Granted these aren't always the be all, end all issues, but it's a great way to let the mind wander.
EDIT: If you're so inclined, using an iPod/iPhone this can be a great time to catch up on podcasts as well.
When she needs time to herself..take that time to do some programming
I don't... :-(
I read about David Allen's " Getting Things Done ", a book about an organizational method:
The Getting Things Done method rests on the principle that a person needs to move tasks out of the mind by recording them externally. That way, the mind is freed from the job of remembering everything that needs to be done, and can concentrate on actually performing those tasks. (from Wikipedia)
The same principles a developer should apply to his work seem to be the one s/he should apply to her/his life. With a little bit of discipline you can improve a lot the quality of your time, reducing the amount you waste.
Nevertheless it's really hard to mantain that kind of discipline - expecially when it comes to the kids (the boss, the customers, the colleagues ;-) http://en.wikipedia.org/wiki/Getting_Things_Done
One of my co-workers once has a very simple solution to this very problem: work from 7:30 to 4:30 every day, without exception. Go home and spend time with the wife and kid. Keep work and home completely separate (to the extent that we didn't know his wife was expecting!). He was also very moved by the book "Zen and the Art of Motorcycle Maintenance" and followed some of its philosophies.
I'm not saying that this approach is for everyone (I don't think it would work for me), but it certainly worked for him. In any case, good luck!
I am reluctant to admit it, but the most important factor is the expectations of the employeer and the boss. You can have all the good or bad habits in the world, but having a manager that is serious about your success on reasonable terms is the most important factor.
The second most important factor is having priorities and sticking to them. When you start a family, you have to make it a priority, and that is reflected in how you spend your time. Things inevitably have to change, and they will keep changing over time. You have to work hard to keep the priorities in control of the clock, and not the other way around.
This also means that you have to service the priorities in order. If family is most important, that means if you have a good boss for a while and now you have a bad boss, it is time to get a new job. You can't sit around and say: "My family is my number one priority even though my job used to be great but now it is eating into my home life." What that means is your job has become your first priority and your family is a nostalgic second.
I find it hard to keep everything in balance. If someone has the answer, I'd be interested to see it, but I doubt there's a hard and fast rule. It most likely takes discipline and relies on us knowing when to stop one activity to start another. I think we all know how hard that can be when we're just one more change and compile away from making it work.
Sleep less. Seriously. (I do...)
Also, this might be generic lifestyle advice - but find a sport hobby that you enjoy and do it regularly. Besides improving your physical health, it's good to completely disconnect from a computed environnment every now and then.
Time division multiplexing!!! :)
he he, just kidding. I am not really experienced in this, and had not thought it could be so serious. Thanks for bringing this up.... :)
Going along with all the people who say you have plenty of time for wife and programming outside work if you would just manage your time better, I bet you probably could squeeze time for a few kids or pets in there too. ;-)
Maybe it's time to use your skills towards quitting your day job? Like, at nights, rather than contributing to opensource projects, start building your home business. Your wife wouldn't object, since you're contributing to your family, and you're having fun, since you're doing what you love. Fast forward a year, you quit your day job, you've got some decent income that's growing, and you've got a lot of time for your family.
welcome to jail :D, but seriously you gotta find time for your passion
It's natural to feel a little oppressed by marriage because as a bachelor you had free rein to do whatever you want whenever you want. Now, it's all about compromise and time management, but the benefits usually outweigh the costs. If not, your marriage is not working out.
Find bits of time you want do things. If you commonly spend your lunch break alone, then spend it with lappy, instead, and work on that new idea of yours. Agree with the wife which days of the week are yours and her's. She needs personal time, too. Lastly, keep tabs on your social calendar so as not to book it too tight. Before you know it, that one last day you had free gets spent on someone's birthday party or impromptu happy hour and you lost your coding day.