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.
"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
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.
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.
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.
I also have meetings during the day, learning I want to do, etc., that takes up my 8 hrs/day.
I rarely max out all of my hours in a day purely programming unless there's crunch happening for a feature release, which is not a good sign. If I'm in crunch mode more bugs than usual are being created.
I program less time now when I first started. I am more efficient and I take more time to think of the proper solution before I even start.
If I were job searching, I'd probably be doing a lot more programming and learning to brush up before any interviews. I am not interview-ready. lol
For pleasure? If I can do it, 2-3 hours in the evening. This is semi-rare too though.
On a productive day at the home office coding can be over 8 hours (plus 1 to 2 hours following company chat).
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.
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.
--
I love writing code... There's writing code and there's what I do in between.
Sure, code isn’t the goal, it’s a means to an end. Code is a liability. Senior SWEs don't write code, they solve problems. And so on and so forth... In a professional setting we deliver solutions as quickly as possible, with an eye on minimizing the maintenance burden as much as possible.
All of this is orthogonal to how much I love the process of thinking about and writing code :-). I feel lucky because I know not every pro SWE feels the same. Also, you don't have to feel the same to have a great career.
When the path is clear and I know what I need to do, and just need to do it, I can probably code 6 hrs straight. Otherwise it's a lot of stop and go. Refactoring is easy, I could probably spend 8hrs straight doing a refactor.
I'd say I spend probably 2-10x more time writing than I do "coding" - where writing is Hammock Driven Development[1] for others to consume
After ADHD meds, especially on interesting stuff, i can do 12 easily.
When I was younger, I'd spend upwards of 60-80 hours a week writing software. I'd do work on my day job as well as personal pet projects. I spent a fair amount of time early in my career in the eLearning space. I had to work across several languages and platforms regularly as well as coming up to speed on the various content domains as well. This was mostly in Aerospace, but also some first responder training and general learning content as well. I've also worked in banking, security and eCommerce over the years.
Other than recently, I've always spent about 10-15 hours beyond work either reading, learning, experimenting or writing code. I've been at this a couple years shy of three decades so far. Between jobs is when I pushed even harder to learn new platforms and languages. From implementing something in a new language or platform to just scratching a personal itch.
In the workplace, I have spent a lot of time when not actively working on features or bug fixes just working to improve the pain points. I worked on an eCommerce site that was setup to email error events to all developers (small team of 3). There were so many emails that everyone pretty much ignored them. I took the time to try and triage the first few emails and see if they were frequent, then taking the time to actually fix them. A huge number were effectively global handlers that mis-labelled what should have been 400 series errors as 500 series, mostly from bots. Others were timeouts because of queries missing indexes in the database. I'd try to resolve at least one a day. After a few months, the emails were at a trickle and everyone started paying much more attention.
It's harder to do some things like this in a larger org sometimes. It really depends. But the best you can do is just put your head down and get stuff done. What you can do and how your time is worked out will really vary a lot from environment to environment or team to team.
One thing to learn, however, is that your job is to solve problems. This may mean writing code (especially more jr roles) or it may be to simply suggest for or against an off the shelf solution. Business doesn't care how elegant your solution is, only that it works reasonably well and effectively. You can get points for pretty, more points for faster, but great code is rarely rewarded.
And usually I'm extremely productive in my deliveries.
It's the time spent thinking and creating the code in your head that matters.
Junior dev btw. I'm assuming that the coding part goes down the more mature I get