Preferences

I'm willing to concede it may be a software thing. There are definitely things where being tired doesn't really affect your output very much.

Mental clarity in software has extreme leverage, probably among the biggest of any human endeavor. Your effectiveness as a programmer is largely a function of how well you can model the software in your mind. Often seeing immediately how to do things correctly vs bumbling forward can be 4 hours of work vs 2 weeks of work. Actually inputting the code is not the thing that takes time. You could write 50,000 lines of code in a day if typing was the only bottleneck.

This is also in the context of a low-distraction environment where there are zero interruptions. If you're working in a busy office, staying late is usually a productivity boost because you finally get some quiet time to concentrate. Which, again, is good for clarity and hence productivity.


> I'm willing to concede it may be a software thing. There are definitely things where being tired doesn't really affect your output very much.

I work on compilers and I'm pretty sure that counts as software.

> Often seeing immediately how to do things correctly vs bumbling forward can be 4 hours of work vs 2 weeks of work. Actually inputting the code is not the thing that takes time.

This presumes one only works on one workstream at a time. I have many distinct workstreams going at the same time (typically 3-4). When I'm blocked on one because of some ambiguity/uncertainty/ignorance I switch to another stream until I decide/find a solution for the first.

Wait, how do you make design decisions while working on another feature? When is the design work for the first feature done if you've switch to another task?

I slip into this sometimes too, but I feel it's a procrastination pattern to avoid thinking about something difficult, and context switching doesn't really move progress on the original hard problem. It's something I typically try to avoid.

The same thinking everyone claims is happening subconsciously when they're showering or riding their bicycle or whatever that doesn't focus on their code also happens to me when I'm not focused on that code.

Recently I had to decide how to rebuild a fairly large component of our compiler (several passes, artifact emission, etc). It took me about a week for the idea (for how to best do it) to occur to me. I spent that time working on our runtime instead. Then once I had the design/architecture, I worked for 2 weeks straight to implement. And during that 2 weeks I figured out a path forward on something I was blocked on in the runtime.

Right, I also claim this happens[1], but my observation is that the background thinking only reliably seems to resolve when you step into the metaphorical shower. If you stay deeply focused on something else instead, the background processing seems to be supplanted with thoughts about the new problem. It's in fact the main reason why I put so much emphasis on stepping away from the work. Whenever I do I come away with a long list of solutions, often at a pace where I'm barely able to write them down before the next one arrives.

[1] https://www.hackerneue.com/item?id=40482328

Your observation is backed up by modern neuroscience. Effective multitasking is largely a myth.

Obviously one can context switch, but every switch comes at a cost. That cost could be hidden by happiness boosts from not having to think about this difficult thing (=pain) and instead do something simpler that feels like lower hanging fruit and gives more immediate gratification (=reward). But the shower you mention is key and can't provide progress on multiple hard things at once. I agree that this is akin to a procrastination strategy and commend you for the analysis and self reflection.

> You could write 50,000 lines of code in a day if typing was the only bottleneck.

I'm not sure about that:

60wpm ÷ 6 words per LOC = 10 LOC per minute

60 mins × 8 hours × 10 LOC = 4800 LOC per day

Yeah but I'm assuming you're using an IDE though, if not copilot. Obviously it's dependent on the verbosity and amount of boilerplate of the language. Probably more realistic in Java than APL.
To write 50,000 LOC in 8 active work hours, you'd need to input a line of code every 576 milliseconds.

But I was just checking the math for fun, not trying to disprove your main point. You could argue that if human thought was not needed to write code, you wouldn't really need a keyboard at all and thus the amount of code you could input would be virtually unlimited.

This item has no comments currently.

Keyboard Shortcuts

Story Lists

j
Next story
k
Previous story
Shift+j
Last story
Shift+k
First story
o Enter
Go to story URL
c
Go to comments
u
Go to author

Navigation

Shift+t
Go to top stories
Shift+n
Go to new stories
Shift+b
Go to best stories
Shift+a
Go to Ask HN
Shift+s
Go to Show HN

Miscellaneous

?
Show this modal