Live data from Hacker News

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

news.ycombinator.com

31–40 of 56 posts

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

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

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

#33
post #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

"Way more data", and you only disagree by 4 minutes. Sounds like you are both right.

Although, median time spent coding would probably be a better measure than average.

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

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

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

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

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

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

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

#40
post #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 g…

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

Post reply on HN