Slashdot Mirror


How Many Hours a Week Can You Program?

An anonymous reader writes "How many hours a week should a full-time programmer program? Trying to program anywhere near 40 wears me out. On a good week, I can do 20. Often, it is around 10 or 15. I'm talking about your programming session at the console, typing — including, of course, stopping and thinking for a minute, but not meetings, reading programming books, notes, specifications, etc., which by comparison feel like lunch breaks. I rarely get called to meetings (which is good) but that means to keep my brain from overheating I spend several hours a week surfing the web (usually reading tech news but also a few stops on Facebook, email, etc.). I should add that I am interrupted a few times per day. Me and another guy maintain an intranet site of a couple dozen web apps for an IT department, so we work on a few different things: phone calls, bug fixes, feature adds, as well as writing new web apps from the ground up, all in a day's work. And I know that wears a person out more than if they had just one project to work on. I wonder if programming is like mental sprinting, not walking, so you can only do it in bursts. Am I normal or stealing?"

37 of 547 comments (clear)

  1. Kind Of Vague by unother · · Score: 4, Insightful

    If you mean purely the process of typing in code, well--that's kind of hard to gauge, isn't it? I've always found that the trial-and-error of development processes means that unless you're working in an orthodox manner it's really hard to separate "thinking" from "doing". Also, I find that when you're in the "zone" it's not painful at all. Sounds like you may be working on something you don't enjoy so much? :D

    1. Re:Kind Of Vague by nametaken · · Score: 5, Insightful

      Yeah, it depends entirely on the environment and what you're used to. It's amazing what people will do when they think it's normal.

      I used to work 40-50 hr weeks just writing code. Mostly web applications like the op does. All day, no facebook or web browsing, all billable hours with two project managers behind me that just had to look forward to see what I was doing. I had two 10 minute breaks (one morning, one evening) and 30 minutes (iirc) for lunch. I worked in a converted warehouse with no natural light, no windows (to stare out of and waste time daydreaming). You learn to do it because that's what's expected of you and what the people around you do. Now I work IT and program for a different company, and I can hardly fathom how I used to do that... or why.

      Fuck that old job and fuck that employer... it wasn't worth it. When I went to leave they offered me another 15k to stay... that's how bad I was being raped all along. Obviously I told them no. I know it wasn't sweatshop labor or anything, I was able to quit and it wasn't particularly hot in there, but reasonably smart people that study and learn a usable skill shouldn't have to live like that. Not in the US.

    2. Re:Kind Of Vague by ShakaUVM · · Score: 4, Interesting

      >>Also, I find that when you're in the "zone" it's not painful at all. Sounds like you may be working on something you don't enjoy so much? :D

      When I'm in the zone writing code, I can easily code for 10 hours straight. However, doing this on a day in, day out basis tends to be wearing from all the focus. When I worked for other people, I found that working about four hours a day when my brain was freshest yielded the best results. Since I was being paid hourly, I wasn't even forced to sit around waiting for five o'clock to roll around. I'd bill four hours and bail out. Got a project that had been budgeted for three years and half a million dollars finished in a summer for (unfortunately) much less money.

    3. Re:Kind Of Vague by deisama · · Score: 5, Insightful

      This is one of the things I struggle with working from home for myself. With no meetings and nothing to distract me, getting in the "zone" is awesome, but can be a little hazardous.

      When I'm that into it, I stop getting hungry or thirsty, I don't get tired. I got to bed at around 6am, because the bright light hurts my eyes and distracts me long enough to think "you know, its 6am, maybe I should go to sleep" even though I'm not the slightest bit tired.
      My dreams are all about the tasks I'm programming, but of course, since they're not grounded in reality, any discoveries there are useless.
      3 hours later, I'll wake up. I'll spend maybe an hour waking up, eating breakfast, maybe watch an ep of the dailyshow, and than its back to the project.

      I did this for 5 days straight once. It's absolutely fun as hell. Challenge after challenge after challenge. Like the best video game you've ever played. Its crazy productive. 3 to 4 months tasks get done in days. And at the time your mind masks all the downsides from you. You never get exhausted or sick of it. You don't realise how much time or days has passed.

      But than you snap out of it. Your bones ache because you've barely moved them. Friends have messaged you and called, and you didn't notice. The fact that you've barely gotten any sleep hits you hard. You'll be fine one second, take a step forward and than all bam, all of it hits you at once.

      And thats if you're lucky enough to have finished your task. If you've forced your self out of it because of "health concerns", than your mind makes it painfully clear, that you don't actually have as much choice as you thought you did in this matter. Almost as though you're being held hostage, you won't be able to focus on anything else at all. Your mind will constantly come up with new ideas that make you REALLY want to go back and see if it works. If you want to watch a show or play a game, you'll be lucky if you can notice the title. If you try to hang out with friends you'll be distant and distracted. If you try to do anything that requires even the slightest amount of thought, you'll be utterly useless.

      And finally, when you're not in the zone its a stuggle. On the one hand, you know that if you could go into the zone all the work you're wasting time on would be blown away. Why should you do any work in this unproductive state when you know you could do it way better and faster when you're in the zone? But at the same time, there's this fear too. I don't want to lose the next 3 or 4 days of my life. Will this next task be the one that sucks me in? If I start this now, will I be able to make it to my appointment tomorrow? And is this strategy even physically healthy?

      I haven't really come to terms with it yet. But hopefully one day I'll find the perfect balance :)

  2. Programming by sopssa · · Score: 4, Interesting

    As long as you're interested in what you program, you can easily do it full work days. However it seems like you're doing the usual code monkey job - these effects are what happens when its not fulfilling or at all interesting. Not in your area of interest and not challenging in the needing-to-think-and-solve-problems way, but just to produce code. That's what it basically comes down to.

    A friend of mine gets his job done and still plays computer games and codes his own projects at work a lot. Since he gets his work done, it's not a problem (though he hasn't told this). Another programmer I know spends 30-40 minutes breaks playing Civilization or other games he enjoys and his boss knows this and likes it because after those gaming breaks he has unwind, maybe has think some of the problems and gets really good programming done again. But he works at a software house, attends to meetings and is in other ways involved in the business too.

    It's no surprise that so many programmers also go as developers later. You get to solve actual problems and do more interesting stuff. When you were a teen, you didn't just program - you developed and spend time thinking what you did. It's no fun if you leave that part out.

    1. Re:Programming by mikes.song · · Score: 5, Insightful

      Yeah, if you are working on your own projects, it's easy to do a sixteen plus hour stretch. Some cola, pizza, and your imagination.

      But, if you are implementing someones broken business logic or accounting rules, I'd guess that three to four hours a week is the norm.

    2. Re:Programming by dsginter · · Score: 4, Interesting

      As long as you're interested in what you program, you can easily do it full work days.

      I think that you are missing the lower level question:

      How many hours per day will your brain allow you to be functional at a given task?

      When I did lots of SQL-based web development, I would toil away for 12-16 hours on some days only to have the answer in my head after a good night's rest. This happened a lot (and was a little frustrating to do in 10 minutes what could not be done in 10 hours the day before). Maybe I just suck at SQL-based web development but the whole concept of a mental limit is interesting to me.

      --
      More
    3. Re:Programming by martin-boundary · · Score: 4, Insightful
      Those 12-16 hours are the price for discovering the 10 minute solution (assuming you didn't just fart around for 12-16 hours). You wouldn't have found the 10 minute solution without them, because it took that long to gain experience in the problem domain and learn how NOT to do things.

      Once you have the experience, the next time you're faced with the same problem, you'll come up with the 10 minute solution without the 12-16 hours of thrashing about.

  3. that's easy by Anonymous Coward · · Score: 5, Funny

    That's easy! I can do 169, no problem. Of course, I'll be tired and I may make a mistake here and there.

  4. Duh by xerent_sweden · · Score: 5, Funny

    168 hours per week. 191 if you're onboard Air Code One and circling the globe in DEFCON style.

  5. The 40 hour work week is God given by Anonymous Coward · · Score: 5, Funny

    Eight hours a day, five days a week was good enough for illiterate industrial workers doing manual labor when it was invented 150 years ago. I see no reason it shouldn't be a perfect fit for highly educated software engineers in 2010!!

    1. Re:The 40 hour work week is God given by 93+Escort+Wagon · · Score: 5, Insightful

      Eight hours a day, five days a week was good enough for illiterate industrial workers doing manual labor when it was invented 150 years ago. I see no reason it shouldn't be a perfect fit for highly educated software engineers in 2010!!

      I grok the humor attempt - but I want to point out that those "illiterate industrial workers" would've thanked God for a 40 hour work week. They were often working 10-12 hour days, six or seven days a week.

      There's a reason unions caught on so well, and a reason companies hired goons to fight them so fiercely.

      --
      #DeleteChrome
    2. Re:The 40 hour work week is God given by kz45 · · Score: 4, Insightful

      "There's also a lot of programmers working 80 hours a week now. Too bad information workers have a genetic pre-disposition toward avoiding unionization."

      or a back-bone. Nobody is forcing you to work 80-120 hours a week. If enough developers refused, the practice would stop. The problem is that there is always a supply of developers that will work those insane hours.

      I personally detest the idea of Unions and I'm glad programmers have avoided them. In most unions, your potential raise is dependent on all the other union members in your department. You also don't negotiate raises, your union lawyers/reps do. No thank you.

      A union is almost like a small version of a communist country. Everyone is equal.

      All of my development jobs for the past 10 years have 40 hours with occasional work after hours. The one job I had that required more than 40 hours on a weekly basis, I quit.

      If you have the skills, you will always find someone that wants you. If not, then a union shouldn't be propping you up or forcing a company to pay you a salary any higher than what you deserve.

      The free market works both ways. It's not a businesses fault that most people don't have the balls to demand a raise or walk.

  6. Re:Not a programmer but... by CorporateSuit · · Score: 4, Funny

    If I can replace you with a program, can I get your salary?

    --
    I am the richest astronaut ever to win the superbowl.
  7. You're Not Like Me Nor Are You Stealing by eldavojohn · · Score: 5, Insightful

    Look, you aren't stealing. You aren't stealing until you're fired and you keep coming to work and forcibly removing money from your employer without their consent. That doesn't happen very often. Whoever says you're stealing by investing your time as you see fit is full of bullshit. You control your productivity and if your employer don't like it, they'll get someone else. It's that simple.

    Now that said, I have no problem doing forty hours of sheer coding in a week. Meetings take up a lot of time but in one of my former positions as a lead developer, I did serious coding to make us look really really good. It involved 50-60 hours a week of being there and 30-40 was actually coding to make sprint deadlines. I mean code overnight into the next day with no sleep. And no interruptions! My god, you would not believe the lines of code (note: bad metric) I can put away with no interruptions. That's what headphones are for. Amen to the large DJ sized headphones I have at work. It's a polite do-not-disturb sign to my coworkers.

    Coding involves also searching online so you don't re-invent the wheel. Aside from that, your list is good. And yeah, meetings are important for coding. How else do I get my requirements other than directly meeting the customer? That's part of coding unless you're leaving that up to some other guy to get (which is a horrible idea in my opinion).

    Anyway, sounds like you're getting the job done and you're not pulling your hair out like I once was. So what's the problem? You may not realize it but you may produce forty hours of normal developer work in those ten hours. I don't know, maybe your code is less buggy than mine? Either way if the paychecks keep rolling in and your employer isn't hold an axe over your head, what's the problem?

    --
    My work here is dung.
    1. Re:You're Not Like Me Nor Are You Stealing by Nadaka · · Score: 4, Funny

      haha. Where I work the customer service phone monkeys in the cube farm next to me use the speakerphone. THE GOD DAMN SPEAKERPHONE.

  8. Depends on what you're coding by mikael_j · · Score: 4, Interesting

    To this day I sometimes catch myself working on some interesting problem at home and putting in 30+ hours over three days when I've got some time off from work, because the problem is interesting and there's no one around to make it uninteresting by coming up with changes halfway through, demanding arbitrary things that have no place in the app and similar stupidity.

    But when I'm at work building some glorified CRUDified spreadsheet in WEB_LANGUAGE_OF_CHOICE and I can't get two hours of coding in before the specs change or some PHB from another department feels like pointing out that the blue background color is a bit too blue for his tastes or whatever, well I sometimes end up taking a lot of little breaks just to clear my head enough to be able to function at all.

    --
    Greylisting is to SMTP as NAT is to IPv4
  9. Age by ucblockhead · · Score: 5, Interesting

    When I was 20, I would program 8-10 hours a day, then go home and code for 4-6 hours into the night.

    Now I get distracted before an hour's coding is up. That's why I moved into management.

    --
    The cake is a pie
  10. i can code htlm all wekk by gyrogeerloose · · Score: 4, Funny

    /p>yessir, i have no problem wiht a 40 hour weel of html coding and i >i>never,/i. maek a mistake.,

    --
    This ain't rocket surgery.
  11. age matters by tlord · · Score: 5, Insightful

    I think it changes with age. When I was quite young, 10 hour a day for days on end wasn't so hard to pull off. Remembering to sleep and shower and brush my teeth were harder. The catch was that a very high percentage of the code I'd write was either pure crap, or could have been done better in less time by writing another program to write that code. As I've gotten older, I've found that it's easier to spend a large number of hours *contemplating* code -- but hard to work other than in smaller bursts actually writing the code. The difference is that when I do write code, the hours are far less wasted.

    I've taken this into account and so now my plan is, that when I reach 90, I'll just wake up in the morning and fart. My heavily customized Emacs will analyze the fart and translate it into C. "Oh, boy, I wrote another new OS kernel this morning!"

    Well, ok, one of the two above paragraphs is true and not the other.

  12. It's a physical thing by phantomfive · · Score: 5, Interesting

    Thinking is a physical thing, it requires energy, and can tire you out. If your body isn't in good health, you're not going to be able to concentrate for long periods of time without getting exhausted. If you aren't feeding yourself properly, you aren't going to have enough nutrients to keep your brain going.

    Now, being in good physical form doesn't mean being skinny: you can have terrible energy levels even if you are skinny, and you can have amazing levels even if you are fat. That said, the easiest way I've found to increase energy levels are first, to get enough nutrients (proteins, carbohydrates, fats, vitamins, fruits and vegetables) so your body can rebuild itself, and second, running. If you can run far, you will be able to program 60 hours a week without a problem. If you want inspiration (ie, extra motivation beyond just high energy levels), check out this book (I've no relation to the author, just found it inspiring).

    Whether you would want to program 60 hours a week is a different question.

    --
    Qxe4
  13. Office space by jimbolauski · · Score: 4, Funny

    Peter Gibbons: Well, I generally come in at least fifteen minutes late, ah, I use the side door - that way Lumbergh can't see me, heh heh - and, uh, after that I just sorta space out for about an hour.
    Bob Porter: Da-uh? Space out?
    Peter Gibbons: Yeah, I just stare at my desk; but it looks like I'm working. I do that for probably another hour after lunch, too. I'd say in a given week I probably only do about fifteen minutes of real, actual, work.

    --
    Knowledge = Power
    P= W/t
    t=Money
    Money = Work/Knowledge so the less you know the more you make
  14. Re:Enjoy your lazy job while it lasts. by e2d2 · · Score: 5, Informative

    He means actual coding sir. He said not reading specifications, meetings, etc. You know, the majority of the actual work being done in software development? Simple fact is we do little coding when compared to the other aspects of the job. That's why I tell kids coming out of college with CS degrees - get ready to learn, again. Because if they think it's all coding they'll be sorely mistaken. I spend more time trying to work with customers learning the domain and getting what they need out of them then I do actual coding. Meetings are required but sometimes lengthy. Documentation takes little brain power but is also required. Deployments are not very exciting but again, required. QA processes can be tedious too. Etc. I do spend some days coding non-stop from 9am-6pm but that's not typical, that's a spectacular day when it comes around.

    That all being said, I do find myself working in a sprinting fashion as the posted does. I'll always be coding when it's time but sometimes you get a burst of speed and intelligence that you might not have every single day and you sprint ahead and make up for the times when you're not so sharp. This cycle goes on and on and it's hard for me to get around it. For instance, I had a burst of inspiration on Sunday and had more productivity in that off day then the entire week previous.

    I defy anyone to focus day in and day out for years and maintain absolute focus at maximum productivity. If you can do that then you're a better developer than me and perhaps a robot.

  15. Obligatory XKCD by Somebody+Is+Using+My · · Score: 5, Funny
  16. Re:Enjoy your lazy job while it lasts. by spintriae · · Score: 5, Funny

    Sorry you to hear you get "interrupted a few times per day" while Facebooking. You poor, poor thing.

    Have you any idea how difficult it is to harvest your crops in only 30 hours a week?

  17. Time worked not an issue by rwade · · Score: 4, Interesting

    You said you usually work about 10-15 hours per week. So that means that on some weeks, you fuck off on the internet for 30 hours a week!?! Sorry you to hear you get "interrupted a few times per day" while Facebooking. You poor, poor thing.

    We need to get away from this paradigm of "You must work 40 hours a week" to the paradigm of "You must do this, this, and this for me and I will pay you X." Sometimes we work the full 40, sometimes we work more, sometimes we work less -- the important part is delivering to your employer what he wants. Clearly, asker is doing that or he wouldn't be employed.

    I subscribe to the "As long as you're not illegally gambling or moonlighting from your desk, and as long as you're getting me what I need and not bothering anyone else, screw around on the Web as much as you want."

  18. Wow. Bitter much? by Weaselmancer · · Score: 5, Insightful

    Oh, and by the way, I'm on my daily 10 minute break. Back to actual work for me. Have a nice 8 hour day doing.....whatever it is you do.

    You sound terribly mismanaged, and understandably a little bit bitter about it.

    Let me tell you something. Best managers view programmers as black boxes. Work requests go in, work comes out. If work>=schedule, then you have a good programmer and that's that. Doesn't matter if he plays Tetris 39 hours a week. If the project gets done, done right, on schedule - why would you care about anything else?

    The worst managers are micro managing nitwits like the one you work for. Seriously, he has a stopwatch and is timing your one single ten minute break? If you take an extra minute or two do you get written up or talked to? Sounds like kindergarten to me. No thanks.

    Look around some. You might just find a job that doesn't make you die of hypertension by your 50th birthday. They do exist, you know. You can work, put in good solid days and make good product - and not be treated like a member of a chain gang.

    --
    Weaselmancer
    rediculous.
  19. Code Monkey get up. Get coffee.... by Itninja · · Score: 4, Funny

    ....its not fulfilling or at all interesting

    This job fulfilling in creative way. Such a load of crap.

    --
    I judt got a nre Kinesis keybiartf so please excusr ant egregiou typos.
  20. Re:Enjoy your lazy job while it lasts. by Stargoat · · Score: 4, Insightful

    That 8 hour stuff isn't possible. How many 17:30 meetings have you been in, or 08:00 corporate town halls? If you work hard for your 40, you'll just be taken advantage of.

    --
    Hoist Number One and Number Six.
  21. I'll play Devils Advocate here by databank · · Score: 5, Insightful

    Is it okay for you to hire a gardener for 20 hours of work and have him actually work 10 hours and take a break for 10 hours?

    Some people may feel that that analogy doesn't have any bearing cause its not in an IT field. Say, if you decide to hire a web design consultant, would you be okay with paying him out of your own pocket for a 40 hour week if it includes surfing the web, chatting with friends over the phone, taking long lunches etc?

    This doesn't mean you need to chain someone down to their job and certainly taking small breaks throughout the day is needed just to mentally refocus, but if you don't feel comfortable paying someone 40 hours for 20 hours of work, why would an employer be okay about it?

    Food for thought.

    1. Re:I'll play Devils Advocate here by hsthompson69 · · Score: 4, Insightful

      I guess the real question here is do you hire a gardner to do 20 hours of work, or do you hire him to maintain 20 yards. If he gets all 20 done in 10 hours, does it matter how many hours it took him?

      In the case of IT, I suppose the problem is that the skill level can vary so dramatically that you can have a "20 hour" task that takes some people 30 minutes, and other people 3 weeks. You certainly can't get away with paying someone for only twenty hours if they work 3 weeks in a row, but it should tell you something about how much you can expect out of them in the future.

      FWIW, I think in the end coding and programming are more like art than like building widgets. Sometimes, epiphanies happen quickly, other times, not so much.

    2. Re:I'll play Devils Advocate here by copponex · · Score: 4, Insightful

      why would an employer be okay about it

      Because the boss is making 300 times your salary, and can't do 300 times the work. He knows that, and you know that, and you both know him flying first class is a waste of money, as is the expensed dinners, "retreats" in Caribbean, the company Audi, the office remodel that cost the company ten or twenty grand..

      Work rules are for the lower rungs of the ladder only, because they are the only ones who actually do anything. The higher you get, the more you get away with, as long as you are playing by the real rules: keep your mouth shut, do what you're told, and don't make any noise about the corruption and waste at the top. If you find yourself making waves at meetings about company waste or using that dirty "ethics" word, you'll quickly find yourself playing by the work rules again.

      That's why the whole top of the pyramid is nothing but pimps and hookers.

      a spade is still a spade, a collar is still a collar
      whether it be blue or white
      it's still around your neck, the silk leash nice and tight
      your wife helped pick it out
      the irony is that you worked 3 hours for it
      you wish you could ignore it:
      you're a hooker

  22. Re:Not a programmer but... by MikeFM · · Score: 5, Funny

    I replaced Al Gore with a small script program and nobody noticed. I was going to replace Rush Limbaugh but I haven't yet figured out how to push that much spam through a pipe without exceeding my system resources.

    If your job is THAT involved I might have to break out something more advanced than Bash.

    --
    At what price learning? At what cost wisdom? The price is a man's peace of mind, and the cost is his life.
  23. To Code or To Develop by Alanbly · · Score: 5, Insightful

    If you're actually writing code more than 50% of your time you aren't thinking enough to warrant anything beside grunt programmer work. Good solutions require research and thought and if you aren't thinking and just coding, you're writing sub-standard code. That said if you aren't architecting anything, if you aren't actually designing solutions, there's no reason you can't stay on task for 40 hours, plenty of people do.

    Personally, I'm of the mindset that good solutions need to percolate. So I'll keep multiple projects going at any given time, and break up the work an any one of them to minimize true down time, and read slashdot during compile/debug cycles. But that's just me.

    --
    -- Adam McCormick
  24. I think it's not uncommon... by PortHaven · · Score: 4, Insightful

    I always found that I coded in sprints. I could get more accomplished in one sprint than in the three days prior. Programming often seems to be a thing of get stuck on some stupid issue totally separate from logic and design (the aspects of programming I enjoy) and finally getting through that stop gap and getting the rest of the code completed.

    I've also found that many times that sprint occurs around 4pm-5pm (yes, when everyone else start going home). This has convinced me that we'd be better off if we offered programmers the option of working three 12 hour days. Such would facilitate longer sprints, and during periods of times with less distractions.

  25. Re:When did UML become "orthodox"? by ppanon · · Score: 4, Interesting

    UML isn't about programming. It's about documentation for large projects that require division of labour. It's about specifying functionality for communication between business experts and the people who get the work done. It's about getting the big picture without having to pour over the whole picture with a magnifying glass (i.e. reading the source code).

    Seriously, I might consider contributing to more open source projects with bug fixes if it didn't involve scanning though megabytes of code first to narrow down the source of the problem.

    Something that I think Sourceforge or an equivalent repository system really needs is a tool for reverse/round-trip engineering UML diagrams of the projects it contains (i.e. identifying how/where code restructuring affects UML documentation and supporting the update of that documentation). One reason why nobody has actually tackled this may be that Sourceforge projects may contain various combinations of Java, C++, python, C, PHP, perl, etc and UML really works best with object-oriented languages.

    --
    Laissez lire, et laissez danser; ces deux amusements ne feront jamais de mal au monde. - Voltaire
  26. Re:Wow. Bitter much? by Weaselmancer · · Score: 4, Insightful

    No, perfectly serious. Problem is you're assuming a constant workload and a perfect equivalence between workers.

    Although I'm a coder we are often put as "leads" in projects. Think "manager lite". And I did put a guy on a team I was leading who mostly plays Tetris. And sleeps in his cube.

    The thing is - he knows more about the system than I do. Way more. The task I gave him took him an afternoon. Would have taken me two weeks, minimum. He banged it out, it worked perfectly, he went back to his Tetris. I'm happy, he's happy, my manager is happy we made the schedule, the customer is happy.

    We're all happy so I don't see a problem.

    I work more than he does, sure. But only because I have to. I'm not as good. I don't begrudge him one single bit.

    --
    Weaselmancer
    rediculous.