barrkel 5 days 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.

  • perrygeo 5 days ago

    Well said. Reading, debugging, reviewing - provides a nice taxonomy for the things we do with code when we're not writing lines of code. I'd also include time spent in books, forums, and documentation as reading about code; sometimes you need the concepts in plain language.

    Given this broader definition of coding, I'd say I do roughly 6 hours a day, with 2 hours spent on email/meetings/etc. The time spent actually writing lines of production code is significant but highly variable - maybe 0 hours for the first week, 25 hours the next. Only when "the road ahead is clear", as you said. So the primary work of software engineer tends to be "clear a path so that I can write code" - which involves reading, debugging, reviewing...

cynicalpeace 5 days 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 5 days 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

  • segmondy 2 days ago

    Breaking out by 10% percent will be neat for your reports, bottom 10% up to top 10%

esperent 5 days 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 5 days 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.

mikewarot 5 days ago

Coding is effectively the casting of magic spells using an IDE and a philosopher's stone (a CPU). I used to be able to spend a few hours at a stretch doing it, before Long Covid, and the decline. Now I get an hour or two a week, if I'm lucky, picking at various projects. I love having something to push to GitHub.

wruza 5 days 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.

ok_coo 5 days ago

Typically 0.5 to 6 (max) in a single workday unless there's something urgent that needs fixing.

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

neilsimp1 5 days 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.

usr1106 5 days 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).

andrewstuart 5 days 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.

dsotirovski 5 days 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.

emmanueloga_ 2 days ago

Yes.

--

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.

ineedausername 5 days 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.

wormlord 5 days ago

There are long periods of figuring out the domain model. Then figuring out the specification of a program. Then a lot of continuous writing until I find a flaw in my domain model. Revisit my previous assumptions, saw and sand away at some rough edges, repeat.

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.

dvt 5 days 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.

bobnamob 2 days ago

Sometimes 0 hours a day for extended periods of time followed by 4ish hours a day of implementation/hacking.

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

[1] https://www.youtube.com/watch?v=f84n5oFoZBc

mklepaczewski 5 days 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!

yungporko 5 days ago

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

  • Serenacula 5 days 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 5 days 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.

niemandhier 5 days ago

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

  • tonyedgecombe 5 days ago

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

    • kzrdude 2 days ago

      Staring into the screen doesn't solve any problems. Have to break it up somehow to actually think - notepad, conversations, walks, shower, lunch, and so on.

    • niemandhier 5 days ago

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

ActorNightly 5 days ago

Pre ADHD meds, maybe 2.

After ADHD meds, especially on interesting stuff, i can do 12 easily.

sh4jid 5 days 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.

tracker1 5 days ago

Lately, I'm close to 0 code. I'm working in an Architect role right now, so most of my time is sitting in meetings and creating design diagrams, etc. I actually kind of hate it as I like writing software. I'm also pretty burnt out in general and haven't been working on much in my off time for close to a year, beyond reading.

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.

blinded 5 days ago

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

aristofun 5 days ago

From zero to a 5. Median is ~1.5.

And usually I'm extremely productive in my deliveries.

It's the time spent thinking and creating the code in your head that matters.

oumugai_123 5 days ago

I am a machine learning engineer and I spend an average of three hours writing code. In individual projects it is roughly four hours.

bemmu 5 days 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.

abdheshnayak 5 days 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 5 days ago

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

ramon156 5 days 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

superconduct123 5 days ago

Sometimes I spend multiple days debugging and end up only changing one line as a fix

revskill 4 days ago

I code for 2 hours but thinking about problem and current solution for 8 hours.

petabyt 5 days ago

Not sure in hours but in LoC, anywhere from 5-10,000 lines of code.

anonzzzies 5 days ago

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

longnguyen 5 days ago

Usually 4-6 hours. I’m a solo founder. 15 years of experience.