For pleasure? If I can do it, 2-3 hours in the evening. This is semi-rare too though.
Ask HN: How Many Hours Do You Code in a Day?
31–40 of 56 posts
Re: Ask HN: How Many Hours Do You Code in a Day?
#32Re: Ask HN: How Many Hours Do You Code in a Day?
#33The 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
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?
#34I 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?
#35When 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?
#36When 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?
#37Re: Ask HN: How Many Hours Do You Code in a Day?
#38And usually I'm extremely productive in my deliveries.
It's the time spent thinking and creating the code in your head that matters.
Re: Ask HN: How Many Hours Do You Code in a Day?
#39Re: Ask HN: How Many Hours Do You Code in a Day?
#40What 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…
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...