<p>I've been thinking about software estimation lately, and I have a bunch of questions around time spent coding. I'm curious to hear from people who have had at least a couple years of experience developing software.</p>

<p>When you have to estimate the amount of time you'll spend working on something, how many hours of the day do you spend coding? What occupies the other non-coding hours?</p>

<p>Do you find you spend more or less hours than your teammates coding? Do you feel like you're getting more or less work done than they are?</p>

<p>What are your work conditions like? Private office, shared office, team room? Coding alone or as a pair? How has your working condition changed the amount of time you spend coding each day? If you can work from home, does that help or hurt your productivity?</p>

<p>What development methodology do you use? Waterfall? Agile? Has changing from one methodology to another had an impact on your coding hours per day?</p>

<p>Most importantly: Are you happy with your productivity? If not, what single change would you make that would have the most impact on it?</p>

[{'answer_id': 13346, 'author': 'Brad Wilson', 'author_id': 1554, 'author_profile': 'https://Stackoverflow.com/users/1554', 'pm_score': 2, 'selected': False, 'text': "<p>To answer some of my own questions:</p>\n\n<p>The current team I'm on does only does gross task estimation, so it's hard to track hours per days. I would say that, for my career, the time spent coding has been anywhere between 25% (mostly management) to 85%+ (working from home 4 days a week, get together for a meeting for half a day once a week). If I had to guess, though, the average is probably somewhere in the vicinity of 60%.</p>\n\n<p>The biggest influence for me in time spent coding is the presence or absence of meetings. When I worked on agile projects with everybody in the same room, meetings tended to be ad-hoc and very short, so the time spent coding was very high. I also felt I spent less time -- sometimes a lot less time -- doing non-coding things when I was in a team room, because it's much easier to waste time, accidentally or otherwise, when nobody has a clear view of your monitor. :)</p>\n"}, {'answer_id': 13370, 'author': 'Bernard Dy', 'author_id': 1577, 'author_profile': 'https://Stackoverflow.com/users/1577', 'pm_score': 5, 'selected': True, 'text': '<p>I\'m a corporate developer, the kind Joel Spolsky called "depressed" in a couple of the StackOverflow podcasts. Because my company is not a software company it has little business reason to implement many of the measures software experts recommend companies engage for developer productivity. </p>\n\n<p>We don\'t get private offices and dual 30 inch monitors. Our source control system is Microsoft Visual Source Safe. Enough said. On the other hand, I get to do a lot of things that fill out my day and add some variety to my job. I get involved in business analysis, project management, development, production support, international implementations, training support, team planning, and process improvement.</p>\n\n<p>I\'d say I get 85% of my day to code, when I can focus and I have a major programming task. But more often I get about 50% of my day for coding. If production support (non coding-related) is heavy I may only get 15% of my day to code.</p>\n\n<p>Most of the companies I\'ve worked for were not actively engaged in evaluating agile processes or test-driven development, but they didn\'t do a good job of waterfall either; most of their developers worked like cut-and-paste cowboys with impugnity.  </p>\n\n<p>On occasion I do work from home and with kids, it\'s <em>horrible</em>. I\'m more productive at work.</p>\n\n<p>My productivity is good, but could be better if the interruption factor and cost of mental context switching was removed. Production support and project management overhead both create those types of interruptions. But both are necessary parts of the job, so I don\'t think I can get rid of them. What I would like to consider is a restructuring of the team so that people on projects could focus on projects while the others could block the interruptions by being dedicated to support. And then swapping when the project is over.</p>\n\n<p>Unfortunately, no one wants to do support, so the other productivity improvement measure I\'d wish for would be one of the following:</p>\n\n<ul>\n<li>Better testing tools/methodologies to speed up unit testing</li>\n<li>Better business analysis tools/skills to improve the quality of new development and limit its contributions to the production support load </li>\n</ul>\n'}, {'answer_id': 13377, 'author': 'Michael Neale', 'author_id': 699, 'author_profile': 'https://Stackoverflow.com/users/699', 'pm_score': 4, 'selected': False, 'text': '<p>Realistically, it probably averages out to 4 or 5 hours a day. Although its "lumpy" - there may be days where there could be 8 or 9 hours of it. </p>\n\n<p>Of all the software developers I know, the ones that write production code (as opposed to research) 4 to 5 seems to be the max of actual coding. There is a lot of other stuff that goes on. </p>\n\n<p>And to be honest there is a lot of procrastination. I find its a bit like writers block. sometimes its just hard to get started, but then a good 2 hour session is a LOT of work done. Its just all the preparation you have to go through, the experimentation to make sure you are taking the right approach. The endless amount of staring out the window and checking email etc...</p>\n'}, {'answer_id': 13379, 'author': 'TheSmurf', 'author_id': 1975282, 'author_profile': 'https://Stackoverflow.com/users/1975282', 'pm_score': 3, 'selected': False, 'text': "<p>I spend about 40% of my day coding. 40% goes to non-coding activites (such as fighting with our sketchy build server or figuring out why NUnit failed with no error message again or trying to figure out why our code has stopped talking to the Oracle server downstaird... junk like that). The other 20% is usually spent procrastinating, or in meetings.</p>\n\n<p>Am I happy with my productivity? Absolutely not. I work 7ish hours/day, and I spend about 2.5 of that coding. I would much rather be spending 5-6 hours of my day coding, with only an hour dedicated to all the other stuff (sadly, the one thing that would make that happen -- that the PM stop diddling with the build scripts every day -- isn't going to happen). Unfortunately, since I am a corporate developer, management doesn't see the time being frittered away. Because I get so much more done in that 40% of my day than most of the drones in the building get done in a week (including the PM), they think I'm productive.</p>\n"}, {'answer_id': 13398, 'author': 'Lars Mæhlum', 'author_id': 960, 'author_profile': 'https://Stackoverflow.com/users/960', 'pm_score': 3, 'selected': False, 'text': '<p>I work a 37.5 hour week.<br>\n30 of those hours (80%) I am supposed to be billing our clients.<br>\nIn reality I find that I use about 60% coding on actual client systems, 20% experimenting with new techniques and reading blogs, and 20% is wasted on office politics and "socializing".  </p>\n\n<p>Am I happy about it?<br>\nDo I wish that I could stare at the screen 30 hours a week coding on my given assignments?</p>\n\n<p>Well. Since 20% of the time is used bettering myself at my craft, in the 60% that is effective coding I probably produce more than I would in 90% of my time if I didn\'t.<br>\nThen again, try to explain that fact to the higher ups ;)</p>\n'}, {'answer_id': 13429, 'author': 'binOr', 'author_id': 990, 'author_profile': 'https://Stackoverflow.com/users/990', 'pm_score': 3, 'selected': False, 'text': '<blockquote>\n  <p>Well, I generally come in at least\n  fifteen minutes late, ah, I use the\n  side door - that way Lumbergh can\'t\n  see me, heh heh - and, uh, after that\n  I just sorta space out for about an\n  hour. </p>\n  \n  <p>...Yeah, I just stare at my desk; but\n  it looks like I\'m working. I do that\n  for probably another hour after lunch,\n  too. I\'d say in a given week I\n  probably only do about fifteen minutes\n  of real, actual, work. </p>\n</blockquote>\n\n<p>For me, switching between projects is a big cause of procrastination. When I\'ve just finished a project I tend to procrastinate on kicking off the next requirement assigned to me. My mind feels still like in coding mode, but I then have to estimate the expenses for creating a spec first. So I have to switch from coding to calling customers and the like, which feels uncomfortable.</p>\n\n<p>What helps me most in being productive is to cut away any distraction in the first hours of the day and starting immediately with the day\'s most important task. I need to get into the flow as early as possible.</p>\n\n<hr>\n\n<p>I recommend having a look at The Programmers’ Stone:</p>\n\n<p><a href="http://the-programmers-stone.com/about/" rel="nofollow noreferrer">We know that stress impairs some cognitive functions. The loss of those functions can precisely explain why programming is hard, and show us many other opportunities to improve the ways we organize things. The consequences roll out to touch language, logic and cultural norms. Click here for the Introduction...</a></p>\n'}, {'answer_id': 13497, 'author': 'Michael Neale', 'author_id': 699, 'author_profile': 'https://Stackoverflow.com/users/699', 'pm_score': 2, 'selected': False, 'text': '<p>@Bernard Dy: I have spent probably 30% of my career in corporate settings (am not at the moment). Usually its after some failed (or not failed, but fizzled) start up idea, or some kind of burnout/change. Its ok for a little bit, it is nice to meet people from totally different backgrounds (who would have thought that lawyers and actuaries could be so much fun to hang out with), but in the end, I just find it too hard to get up in the morning with motivation (or after a holiday dread going back) - probably for reasons like you define (just a lack of care). But its good experience and a source of ideas at the least. And you can meet brilliant people everywhere (its not just programmers who are smart - I always tried to seek out who the real brains were behind a business).</p>\n\n<p>Interestingly the only time I have practiced strict agile/XP was in a corporate setting - in that case probably 7 hours a day was actual hands on code (in a pair) - I have never been so exhausted after a day of that. not sure if that is a good thing, perhaps I am just lazy.</p>\n'}, {'answer_id': 13556, 'author': 'Nelson Miranda', 'author_id': 1130097, 'author_profile': 'https://Stackoverflow.com/users/1130097', 'pm_score': 2, 'selected': False, 'text': "<p>I do outsourcing and basically I code all day, I have two projects and I don't have much time to make anything else which it means that I can't take more work cause I could not finish anything, that is a good policy, you should take just as you can. </p>\n\n<p>Remember also that that you should have spare time and very importantly is to rest enough because if you don't you won't be very productive. The key here is planning and discipline.</p>\n\n<p>In my non-coding time I spent it with my wife, I also like to get out town and try not to think on my projects, the more I make this balance the more productive I am.</p>\n\n<p>When I don't much work I like to read programing blogs and also I like to study programming.</p>\n\n<p>And finally I would like to say that IMHO our carreer should not be seen as a work, instead you should see it like something fun.</p>\n"}, {'answer_id': 9800326, 'author': 'Coral Doe', 'author_id': 1252063, 'author_profile': 'https://Stackoverflow.com/users/1252063', 'pm_score': 1, 'selected': False, 'text': "<p>I'm a software developer in an R&amp;D department working 40 hour a week.</p>\n\n<p>I spend like... 10% of my time actually coding.\nIn my non-coding hours I mostly test, evaluate, compare and put down results. I also spend a lot of time writing specification for the code I will write and researching for the code I will write, I participate in brainstorm meetings for the current projects, etc.</p>\n\n<p>I could say that from my teammates (also software developers) I am the one who codes most at the moment; but in depends on which task we work at each time.\nI would not quantify actually coding as working hard. If there is a good specification, a proper research and a good understanting of the project, coding is just a <code>formality</code> and goes on almost smoothly and quickly.</p>\n\n<p>Here we have a sharred office, with two teams. We are mostly coding alone, rarely on a pair. My work changes a lot the amount of time I was coding; in the past I was spending most of my time coding, without a very good understanding of the coding. If I had a task I would immediately start coding, and re-coding each time I realised I did something wrong and so on. And it was very ineffective.</p>\n\n<p>The development methodology is somewhere between prototyping and spiral now. It has clearly change the number of hour I code.</p>\n\n<p>I am happy with my productivity, related to my deadlines and goals. </p>\n"}]
['https://Stackoverflow.com/questions/13343', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1554/']