Hacker News new | ask | show | jobs
by drblast 3359 days ago
I seem to be alone in this, but I actually do about 25-30 hours of actual programming work each week. And that's sit-down-and-concentrate-and-build-shit work. I'm pretty ruthless about declining extraneous meetings and I keep my door closed most of the time.

I think it's reasonable to have 25% of a 40-hour week be for meetings, helping other people, eating lunch, sitting in on interviews, and learning/trying out new things.

And yeah, 25-30 hours is probably a maximum, and it needs to be done in three-hour chunks at a minimum. As a manager you can easily destroy that by allowing an environment where a solid three-hour block of time never happens for a dev.

12 comments

> And yeah, 25-30 hours is probably a maximum, and it needs to be done in three-hour chunks at a minimum.

There's a fascinating corollary on "effective working time" research. I've seen the numbers multiple times in Finnish press, but have hard time even finding them now - and can't recall ever seeing these figures in English media.

According to work wellbeing research done (at least partially) in Finland, knowledge workers can achieve approximately 5.5h of effective work a day. Any hours much beyond that are mostly wasted due to the level of concentration required.

This number chimes well with your estimate: 25-30 hours of effective work per week. I'm quite confident these figures would come up again and again.

I think there is a problem defining what is effective when talking about creative work.. I did some contract work a few years ago and while I worked from home and tried to be on task during working hours I was not always at the keyboard during that time. Sometimes I sat on the couch with my eyes closed, and I went for a walk on the beach regularly but I was always thinking about the way in which the code I was writing was developing, the shape of the algorithms and how best to interface to other modules. I even thought about that stuff out of hours (which was unbilled time, though I got a hefty bonus..).

When you take this concept of effective working time to the statistician who sees only the time you spent actually at the keyboard and tells the MBA that your effective time was 2-4 hours out of an 8 hour shift, and that MBA wants you to increase this effectiveness by getting it to 100% of the time that he is paying you.. then thats not going to work.

> Sometimes I sat on the couch with my eyes closed, and I went for a walk on the beach regularly but I was always thinking[...]

I worked from home for 7 years, and during the brief summers I took 1-2h biking breaks during the day when I was stuck and felt like my mind was grinding to a halt. Often enough I would get unstuck, or at least have lots of new ideas.

On the flipside, I also learned that one of the most valuable pieces of equipment in these circumstances is a lightweight dictating machine. Or a phone capable of recording on a keypress. The ideas would come and go, and if I didn't record them when they popped up, I would spend quite a lot of time trying to find them again.

Taking notes is underrated.

I do this with running from time to time. It's a great way to solve problems. Stuck on something for a few hours? go for a run! I'd usually have some sort of solution by the time I get back.
This is why I want an MBA. I know and respect these things.
A huge time sink is thinking. I just mentally plan the most effective and long term solution before coding the task at hand, so whatever I write doesn't come to bite me later. From the outside, it looks like I'm fiddling. And most of the time, it goes on even when on in office because the mind can't be turned on and off easily it goes on and on ever at home
> From the outside, it looks like I'm fiddling.

Indeed, sometimes I'm stuck "watching" something on the screen (it looks like I'm watching a movie) maybe for extended periods of time. Then suddenly I jump and grab a pen and paper, and in a couple of minutes I get everything I've been building up written down, which helps me in solving the last details.

The opposite is true too, sometimes I'm in a bind and can't get myself to work on some task trying to get into flow, and it turns out fiddling like that (opening random terminals, typing useless commands, navigating some code and skimming through some source file) definitely looks like I'm frantically working.

What are you guys coding that makes you think so much? Most of the time I either code or research a particular tech. I rarely have to think about stuff too much...
when the codebase is old enough, you need to think about all the dependencies of every component you change when adding features. that's the major drag to me.

also, browser compatibility, that also requires load of prep work because of the layers of workaround to get stuff working right.

I am the same. I'll just fiddle around with boilerplate code or procrastinate off other tasks, but that is only semi-consciously. What I am really doing with like 60% of my focus is trying out different designs/architectures around a problem. This might take a few days until I figure out a design that fits the task, but once I'm satisfied, it's usually only a few hours to code the thing.

Worth noting, this process can be significantly sped up if you have a set of peers (or smarter) people to discuss with.

You have a door: there's your 50% productivity boost.
Seriously. Every day I go in I think about how much more productive I could be if I could literally shut out distractions with a real live door.
You have a door?! Is your company hiring?
Not with this hype for open office space you don't! ;)
The cynical side of me interprets this as: you can leave if you don't like it.
That is so awesome... you have a door?!?
I have an office. Intermediate dev/ba.

I've gotten a taste for it now. I could reluctantly work in a small shared office with other programmers, but I would have to be desperate to ever go back to an open office. That or get paid a lot.

Good headphones work to some extent too.
That's only a part of it.

It's also a sign you're not valued. Let's see how many of you we can cram in there.

Many buildings in areas with lots of defense and medical industry will be set up to be all offices.
I'm glad I get to work in a hybrid environment. We all have laptops for the actual coding. Have a number of rooms, lounge areas and meeting spaces as well as a central open area for coding. I usually code collaboratively with some of the team members in open space. Sometimes alone in lounge with good music in background, sometimes in a closed room whichever gets me in the zone. The rule is if you don't see someone in open area then you gotta slack.

I absolutely believe giving developers the freedom to choose a personal space with walls and doors is very essential to productivity.

Being able to actually program for 25-30 hours per week sounds like a dream. I'm lucky to get 5-10 solid hours of programming a week. I still refuse to work overtime.

/team lead

You're not alone. I, and everyone at work except perhaps our CEO, get probably 30 hours of focused programming done, with the caveat that probably around 75% of that programming is done in pairs. Which still feels like very productive programming most of the time. We do this by using the pomodoro technique and TDD (although I'm sure there are lots of other ways, and that it's mostly a combination of company philosophy and a fitting business model and product).
I've always liked pairing because it ensures that you're both there to get the thing done, and generally I've found that it keeps both of us from goofing off (until the thing is done, then it's time to play). While the theoretical throughput would be 50% (two people doing one thing), it ends up being greater than if we had both tried to work on different things, since the one thing we're doing comes out better since it's getting reviewed while written + any problems which come up can be solved much much faster. Plus, both people always learn at least one little thing, typically more.

Pairing is just great. Works well for sysadmin stuff too, even if I'm mostly leading that and just bringing someone else along for the ride.

I like pairing for those reasons as well. Also, I can keep my concentration up more easily when there is a requirement for me to do so, e.g. when I'm intercommunicating. It's when I talk to myself that I get distracted the most.
I used to do the same as a defence contractor. We coded in a team of two, or sometimes with a third wheel who was learning. About 1.2x more productive, but rewrites and dead ends became rare.
What kind of business are you in that the entire company except the CEO is programmin full time?
Online productivity tools. No investments, profitable, linear but steady growth, minimal marketing, small team size, close to zero process. Works great for us programmers. And the CEO does a lot of programming as well, if I'd venture a guess I'd say about 40-50%.
I still can't imagine that this makes sense. Even if everyone is a developer on paper, you should be spending more time on all the other parts of running a company. CEO still writing code half of the time when everyone else is writing code all the time puts it over the edge. Don't you also need Designers, QA, Ops, Marketing, or CFO?
You might find it hard to imagine, but that's how it is. I can't say exactly how much time the CEO spends on other tasks out of office, but I know that he at least does a lot of coding while he's at the office (which is most of the time). As I said, we have a minimal amount of support issues and marketing. We also don't do meetings. We don't spend a ton of time on design, and when we do, everyone participates. But that's a very small amount of time compared to the time we spend writing (or thinking/talking about) code. QA is part of the coding process. CFO is outsourced/done by the CEO. The point is, all the developers except the CEO spends at least 90% of their time coding (in pairs).
It's basically a matter of how much control one has over their work environment and distractions.

I work from home, and I have a high enough social standing in my company that I can simply decline incoming phone calls whenever I want. As a result, like you, I can get a shitload of work done.

Most developers aren't so lucky though. That's why the productivity norm in our industry is closer to 10 hours per week, maybe 15.

I went from a fortune 500 to a self-supporting start-up. I was surprised not to have a phone on my desk. It didn't take long to realize how great it is not to have a desk phone.
This is my sentiment exactly. The stuff I produce in the 30-40 hour segment is significantly worse than the first 30. Also, meetings/helping out is perfectly fine, but maintaining 3-hour chunks are still crucial to productivity.
Putting in 25-30 good, quality hours at work each week and then 30 more hours a week on my pet project, I would not classify an hour as good depending on if I produced code or not. A good hour too me is one where I could keep my concentration on work, thinking or coding.

It's doable, working two shifts. It takes a 30 minute walk from work to home to reset and prepare myself for shift #2. If my boss want both those shifts though I shall ask for double the money. I don't see how I could be working any more. This is my max. Both shifts require a creative and hungry mind. I'm very hungry at the moment but I suspect this is a phase.

Most jobs require 8 hour day. If you add 6 on top of that, plus walk to-from work, that's 15 hours per day on just work. When do you sleep and eat?
> I keep my door closed most of the time

What I wouldn't give for a door... I'm not even allowed to wear headphones, so I get to field constant walk ups whilst listening to an entire high ceiling-ed office full of executive assistants all screaming at each other across the floor.

Do your worst, skeptical HN, but I swear on my life I've been maintaining more than 80 hours of ridiculously productive, focused coding time per week, for about a year. It so different when you love and believe in what you're working on. I literally can't wait to get out of bed and start working, and the entire day goes by before I notice. The thing I'm working on is a sheer joy to work on, and the conditions are ideal. I'd wager the inability to focus for N hours is related to the stress of having to force yourself to focus on something you wouldn't be focusing purely for the sake of it.
I love and believe in what I am working on, I usually can’t wait to get out of bed and start programming, and that’s exactly why I force myself to stop after a reasonable number of hours. Because I know 80 hours a week (or 40 hours a week) of programming would not be sustainable for me. That much work would simply destroy my life outside of work and harm my productivity at work. Short-term gain, possibly, long-term loss, inevitably.
An interesting exercise is to run RescueTime for a few weeks and see what your daily average is. I'm reminded by this thread: https://news.ycombinator.com/item?id=208818

I certainly believe people can be extremely productive for, say, 100h/w. For example, see Elon Musk for a straightforward counterexample to the "40h/w is peak absolute productivity on a sustained basis"-crowd. But it is useful to separate effective coding time from other productive, and not so productive, time. Empirically speaking, as evidenced by the thread and its sampling of highly motivated YC founders, few people average more than something like 4 hours of effective coding a day.

EDIT: I mean what I say in the first paragraph quite literally. Run Rescuetime for two weeks. See what it reports for Software Dev. That is close enough for effective coding time. It isn't rocket science. Self-reported numbers are almost without fail vastly overestimated, even for expert practitioners.

Well, everyone's different. I don't know what kind of gotcha is hiding in the word 'effective'. It's routine for me to spend 14 hours in a day actually writing and refactoring code, and it seems pretty wildly effective to me.
You need to be thinking of a career of 30+ years rather than a 3 year sprint.

It's cool you're spending your time producing, but don't forget you need to take care of yourself and hone your fundamentals (linear algebra, data structures, algorithms, your field).

Well... As pg mentions in one of his essays: the startup game is about getting the rewards of a 30 year career out of 4 years. If you truly believe that you are building something that matters and you are going to win, 80 hour weeks make a lot of sense.
As pg doesn't mention though, statically you won't reap "the rewards of a 30 year career out of 4 years" regardless of how hard you work and whether you "truly believe that you are building something that matters and you are going to win".
I've already had a career of 30 years :) (really, 25)
Sounds great. But how many years will that carry on for? Surely whatever you're choosing will be complete in the next month or two of 80 hour weeks?
It's been going on for a year, and will likely be done this month. So yes, there's maybe an end. Maybe. But it was extremely enjoyable, not something I'm looking forward to ending, like a crunch at an employer.
Do you have a family?
Noop!
I've bursts. Sometimes I can work three days non stop and sometimes I strugle to write any good code. Luckily I've some margin to decide on what to work every day so I do documentation or unit/integration testing the days my brain is downclocked.