Not too long ago, I lost a week of work and was able to recompose it in the space of an afternoon. It wasn’t the same line-for-line, but it was the same design and probably even used the same names for most things, and was roughly 10k LOC. So if I had recent or substantial experience, I can see expecting a 10x speedup in execution. That’s pretty specific though; I don’t think I have ever had the need to write something that was substantially similar to anything else I’d ever written.
Domain experience is vital, of course. If you have to spend all your time wading through header files to find out what the API is or discover the subtle bugs in your use of it, writing just a small thing will take painfully long. But even where I never have to think about these things I still pause a lot.
One thing that is different is that I make mistakes often enough that I wait for them; working with one of these people, I noticed that he practiced “optimistic coding”; he would compile and test his code, but by feeding it into a background queue. In that particular project, a build took ~10 minutes, and our test suite took another ~10 minutes. He would launch a build / test every couple of minutes, and had a dbus notification if one failed; once, it did, and he had to go back several (less than 10, I think) commits to fix the problem. He remembered exactly where he was, rebased, and moved on. I couldn’t even keep up with him finding the bug, much less fixing it.
The people around here who have a million lines of code in production seem to have that skill, of working without the assistance of a compiler or test harness; their code works the first time. Hell, Rob Pike uses ed. He doesn’t even need to refer to his code often enough to make it worthwhile to easily see what he’s already written (or go back and change things)---for him, that counts as an abnormal occurrence.
Not too long ago, I lost a week of work and was able to recompose it in the space of an afternoon. It wasn’t the same line-for-line, but it was the same design and probably even used the same names for most things, and was roughly 10k LOC. So if I had recent or substantial experience, I can see expecting a 10x speedup in execution. That’s pretty specific though; I don’t think I have ever had the need to write something that was substantially similar to anything else I’d ever written.
Domain experience is vital, of course. If you have to spend all your time wading through header files to find out what the API is or discover the subtle bugs in your use of it, writing just a small thing will take painfully long. But even where I never have to think about these things I still pause a lot.
One thing that is different is that I make mistakes often enough that I wait for them; working with one of these people, I noticed that he practiced “optimistic coding”; he would compile and test his code, but by feeding it into a background queue. In that particular project, a build took ~10 minutes, and our test suite took another ~10 minutes. He would launch a build / test every couple of minutes, and had a dbus notification if one failed; once, it did, and he had to go back several (less than 10, I think) commits to fix the problem. He remembered exactly where he was, rebased, and moved on. I couldn’t even keep up with him finding the bug, much less fixing it.
The people around here who have a million lines of code in production seem to have that skill, of working without the assistance of a compiler or test harness; their code works the first time. Hell, Rob Pike uses ed. He doesn’t even need to refer to his code often enough to make it worthwhile to easily see what he’s already written (or go back and change things)---for him, that counts as an abnormal occurrence.