Hacker News new | ask | show | jobs
by onreact 2386 days ago
When I was still a coder - I moved on after a few years - I noticed that working long hours made my work quality suffer.

The longer I worked the more bugs I introduced and the more I looked for the bugs in the evening the worse it became.

Ensure a proper work-life balance and plenty of screen-free time. Do not spend the night gaming when you work onscreen all day already.

The ideal per day work hours are 4h! No joke. In case you have to work 8h or longer perform simple tasks in the remaining 4h (meetings, documentation, emails, errands).

Eat well, get enough sleep, exercise, meditate, go outside and the next day you will find the bug and fix it within 10 minutes.

Many programmers tend to be the prototypical zombies who never see the light of day and only survive on caffeine (give it up). Remember that you're human.

3 comments

It's kind of funny how no one will admit in front of the boss that 4 hours of development a day is enough, but all developers I've talked with outside their work environment seem to think the same.

I can easily spend more time on screen, before or after work. But getting back into development after work really takes a lot of mental energy for me.

Yeah, sometimes I do fall in this vicious circle of overwork / decrease in productivity. Trying myself to get out of it, but the stress/anxiety surrounding a deployment/making a mistake is way too high for me to decisively get out of it.
Yeah, and that is the actual self-fulfilling prophecy. You make what you actually are afraid of happen by behaving in a way that causes the quality issues to appear.
Is it 4h for every person? Are there people who can do it for 12h every day, 7 days a week while delivering quality code and not getting burnt out?
I've been coding for >25 years, and leading teams for most of that.

I've never met a developer who could consistently do good work for over 40(ish) hours a week.

My rule with my teams is that I expect them to be "present" (even if remote) for 8 hours. The norm is about 6 hours of that to be actually coding, the rest is communication (which is vital).

If there's an urgent deadline, I'll let people stay to about 10 hours. After that, though, they're just going to be damaging the code base, so I send them home. And at this point, this became a scheduling fault rather than a developer fault. And the developer gets time off in lieu if they do >8 hours.

I've learnt this set of rules from experience. When I was younger, I thought I could code for days straight (and once pulled a 36 hour marathon, which was a disaster). I was wrong. I've watched lots of other people do the same.

If you don't believe it, try it. Pick a project and work at it for 12 hours straight, and compare your bug count / code quality in the first couple of hours to the last couple of hours.

It's always interesting to read about different management styles. As someone who leads a large development team, this breaks two of my golden rules. 1) Don't micromanage and 2) Don't assume a "Daddy knows best" attitude. At the end of the day, we're shipping a product and as long as everyone is meeting their expected goals, I don't really care if they spend 8 minutes or 80 hours in the office. I tell my kids when to go to sleep, not my employees. If they want to work longer hours and get more done, they'll receive comp time and a nice bonus.
I get that, except I've had to send people home who were clearly past the point where they were doing any good, but felt that they "should" stay and get the thing finished. There's a lot of that kind of thing around - people feeling that they need to work long hours in order to keep their job, or show that they're committed, or whatever. Sending them home deliberately reinforces a culture of not doing that, of being responsible.

Working longer hours does not "get more done". It just creates more problems.

Sure, some people can work longer than others but they also may get sick more often then. A friend of mine used to work 10h/12h and then game at night but was chronically ill with his skin. It only really got better when he went on vacation.

The 40h work week has been introduced by Henry Ford 100 years ago because even in factories with dumb menial work people were getting tired and breaking more than making after 40h.

In creative industries that require programming, graphic design, writing etc. you can't assume that people will be doing good work for as long as factory workers do who only have to focus on the same repetitive tasks.

4h seems to be an accepted limit of any focussed creative activity. After that the quality of your output will start to decline until you're just giving yourself bugs to fix tomorrow.

Obviously if you're doing routine work you'll be able to carry on much longer.

Concentrated coding is a bit like doing a college math exam every single day.

Based on pretty much everything I have seen and read, no one can work 12h every day, 7 days a week and deliver quality. Simple, such person does not exist. People can spend a lot time in work doing all kind of adjacent stuff - staring into wall during long meetings, talking with colleges, staring into screen, etc etc. Too much overtime also leads to a lot of fixing of mistakes that did not had to be. No socialization outside of work invariably means a lot of unnecessary long meetings, because people need to talk and this is their chance.

However, if 4h limit really exists, imo, it will be about focused hard stuff. Many many programming tasks are not difficult and you can safely easily do them longer. You can also mix programming with analysis, architecture, design, helping people etc etc easily being able to productively occupy yourself for more.

It's less for me because by the time I get to work my mind has been running at 100mph since I woke up, thinking about physics or maths or the book I'm trying to write. I wear myself out within hours of waking up. By mid afternoon I'm wacked. Been the same all my life :(