Live data from Hacker News

Ask HN: How Many Hours Do You Code in a Day?

news.ycombinator.com

21–30 of 56 posts

Re: Ask HN: How Many Hours Do You Code in a Day?

#21
post #9
post #7

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 sessi…

> 24+ hours I'm impressed that you manage to code for more than 24 hours in one day. (Yes, I know what you meant. It just seemed funny.)

#1 on the list⁰! (But I don't blame you)

⁰. https://gist.github.com/timvisee/fcda9bbdff88d45cc9061606b4b...

Re: Ask HN: How Many Hours Do You Code in a Day?

#25
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.

Re: Ask HN: How Many Hours Do You Code in a Day?

#26

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 p…

WakaTime has way more data and puts the average at 48 minutes of typing code per day:

https://wakatime.com/blog/65-wakatime-2023-programming-stats

Re: Ask HN: How Many Hours Do You Code in a Day?

#27
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

Re: Ask HN: How Many Hours Do You Code in a Day?

#28
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.

Re: Ask HN: How Many Hours Do You Code in a Day?

#29

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

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

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

Re: Ask HN: How Many Hours Do You Code in a Day?

#30
post #27

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]: http…

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