30 comments

  • barrkel 3 hours ago

    What is coding?

    Actively typing in code, maybe 30 minutes long term average, with spikes up to 8 to 10 hours when the road ahead is clear and what to do is obvious, which happens about once a year for a few weeks. It's quite rare outside of greenfield, which itself is rare. It's much more common in hobby projects.

    Debugging? Sometimes I can spend several days debugging a problem, not actively writing any code which goes into production, but creating harnesses, ad-hoc logging, verification / assertion routines and so on. The amount this averages to depends heavily on the maturity of the product and the health of the code. A mature product with a gnarly codebase means a lot more time debugging.

    Reading code? I spend a fair amount of time reading and analyzing code before a chunky task, figuring out where the seams are, where the data I need comes from, what the best places to add code are, figuring out data flow. When I'm at the start of a task like that, I can do that for 3 or 4 hours a day. But long term average, it's more like 10 to 20 minutes?

    Reviewing code: this is similar but different to reading code. I don't do as in-depth reading as I do for a task, but if I find something suspicious and I want to make sure I'm right, I can go for an hour or two on research, to prevent something problematic hitting production. But I guess this averages about 20 to 30 minutes a day long-term. I don't do as much code review as I used to when I was more senior roles before. Expect a lot more code review with more seniority.

  • cynicalpeace 4 hours ago

    The answer can (seemingly?) be found on a VSCode extension called Code Time. It keeps track of how much you've been "coding" and "actively coding".

    "Your code time is the total time you have spent in your editor today. Your active code time is the time you spend actively writing and editing code in your editor or IDE".

    They know as well as anybody the answer to the question on a statistical level, and can answer it personally for you too.

    Their data shows most programmers code less than 1 hour a day, for a grand total of 4 hours 21 minutes a week: https://www.software.com/reports/code-time-report

  • welder 2 hours ago

    WakaTime is the most popular automatic time tracker for devs. We release a report each January about the time devs spend coding using our platform [0] and the average is 48 mins per day. However, there's room for segmenting by things like languages, editors, job description, student vs full time vs contract. Maybe this year we'll segment our yearly report to show daily average segmented by these attributes.

    [0]: https://wakatime.com/blog/category/yearly-code-stats

    • AlchemistCamp an hour ago

      Does this include time in the terminal using a REPL to poke around in the code or debug things?

  • esperent 5 hours ago

    If I push myself to get as much done as possible in one day, maybe 4 or 5 hours. After a few days like this I'm exhausted.

    If I follow the natural rhythm of my energy though the day, about 3-4 hours in the morning, followed by a several hours long break, then another 3 hours in the late afternoon/early evening. So about 6-8 hours total, and I can sustainable do it for many days in a row.

    The issue, of course, is that I have a life, people want to schedule meetings with me, or I want to go for dinner with my family or friends. As a result it's hard to coordinate my work so that I'm following my natural energy cycle.

  • pytness 4 hours ago

    It depends how you measure the time i guess. I would say from 4 hours to 6 hours on an average workday (thats what wakatime says at least).

    But is writing code, stopping for reading docs / thinking and continue writing code counted as 1 big unit of coding, or 2 small?

    I dont code that much outside of my work anymore, buy i could go for 17+ hours when I was younger.

  • neilsimp1 an hour ago

    For work? Maybe 1 hour, maybe 2, if I am really lucky.

    For pleasure? If I can do it, 2-3 hours in the evening. This is semi-rare too though.

  • dsotirovski 3 hours ago

    I'd say it averages around 3 hours, with significant amplitudes.

    My specific job consists of helping/automating my client's business problems/objectives and most of my effort is oriented around figuring out the domain and value I could bring to it.

  • usr1106 5 hours ago

    That varies a lot. In non-productive weeks I hardly look at the code I should work on, there are customer problems to investigate, documentation to produce, meetings to attend, chat messages to answer.

    On a productive day at the home office coding can be over 8 hours (plus 1 to 2 hours following company chat).

  • wruza 6 hours ago

    Could be anything from 8 to 24+ hours sessions (with some pauses) when I started, later in life settled on 5 hours a day when I work - that’s my peak time spent * value added mode. I avoid big pauses and chitchat cause that costs focus. I also avoid deadlines, except for “done; start it today” mode. I do code outside of “job”, but it’s hard to tell how much because it’s irregular and one-shot.

    Recalling my long sessions when I was young, no value in these. I could spend many hours doing some nonsense just because I could. It was more like fiddling than coding and I’m not sure it was as demanding as real focused work. Pretty sure I can still fiddle all day and night, just without that much enthusiasm. I guess it helped with understanding fundamental things which turned out to be finite.

    Night time is the best. Mornings I just sleep through, completely useless time for me. Probably due to ambient sounds.

  • mklepaczewski 3 hours ago

    Usually five-ish hours. These days, I spend a lot of time in Asana, replying to emails, etc. I wish I had the time to code more!

  • ineedausername 5 hours ago

    I'm 6 years into this "career" (more like a job than a career but anyway) and now I'm coding probably 4 hours per day. It wasn't that different in the beginning though.

  • niemandhier 5 hours ago

    2h. The rest of the time is spent thinking.

    • tonyedgecombe 4 hours ago

      Does that imply you aren’t thinking whilst you work ;)

      • niemandhier 2 hours ago

        I know that is a joke, but: Yes, 2h of programming without conscious thought, total mental exhaustion afterwards.

  • dvt 7 hours ago

    "Coding" per se is a bit hard to quantify, but I at least write, read, or review/look at code for (I'd guess a minimum of) 2 hours a day since I was like 14 (38 now). If I'm working on a project, I can write code for 6+ hours a day (especially if it's boilerplate or doesn't require much thought). If it's deeper, more work goes into the planning/architecting, and less in the actual coding.

  • bemmu 5 hours ago

    As a gamedev coding is maybe 1/3 of my work, but I aim for 3h/day (plus some on weekends) total for all productive tasks.

  • anonzzzies 3 hours ago

    Around 3; the rest is spent thinking and having AI write code.

  • yungporko 6 hours ago

    i work full time as a developer so... 2ish?

    • Serenacula 5 hours ago

      This sounds more familiar to me. xD 8 hour day, in a place with a nice or relaxed working culture that turns into 6 hours. Minus lunch break, 5. Minus meetings, 4. Minus helping others, 3. Minus whatever procrastination during the day, in practice 2 hours on actual code.

      I could see that going up to 5 depending on the working environment. But people answering 7+ hours seems bonkers to me, that's more than a working day!

      • tonyedgecombe 4 hours ago

        I worked 8 hour days in tech support but that doesn’t involve much thinking.

        I’m extremely sceptical of people who say they can code for that amount of time.

  • ramon156 5 hours ago

    Programming? 6-8 hrs Coding? 3 hrs

    Junior dev btw. I'm assuming that the coding part goes down the more mature I get

  • sh4jid 7 hours ago

    Some days I don't code at all, some days I code 8-12 hours. For me, I find it hard to consistently coordinate between my academic efforts and coding projects.

  • andrewstuart 2 hours ago

    Sometimes I think for hours and hours trying to work out how to do something.

    More often I’m thinking about how to avoid doing something. A really great days work is thinking until a whole bunch of coding never needs to be done cause I thought of a way to not do it.

    Sometimes I attack myself for thinking too long on how to do or not do something instead of rolling my sleeves up and starting to code. But then I ease up the attack because there’s no clear way to know when you’ve done too little, just enough or too much thinking.

    Some of my best coding outcomes have been the result of six hours or more staring at the screen, looking at the ceiling, pacing around the room, reading and researching, looking through code, maybe trying out a few theories with little test programs.

  • blinded 7 hours ago

    Few at work, few at night if I don’t have other plans.

  • abdheshnayak 7 hours ago

    On average, I code for 8-10 hours a day. However, if the task is particularly challenging, it can extend to 14-16 hours

    • boundless88 7 hours ago

      Are you always busy? How do you manage tasks like writing documents, attending meetings, or learning new things?