I was also a bad developer. Then I was a "clever" developer. Then I was rewriting everything from nothing because I needed to know how it worked. Doing so is a great way to get a sense of how much "secret sauce" there is in a domain. The C++ standard library has a lot for instance. My naive implementations never came close.
> I suspect a lot more code gets written by junior developers than we'd like to think.
This may be true if you just measure lines of code. But if you couple that measure with the number of times each line was actually executed I suspect you'd see a different story. My library, for example, was comparable in size to parts of the standard library it replaced. So by direct measure a junior developer wrote half the code. But when you measure it by usage you can see the magnificent results of the 10x programmers at Boost and otherwise working on the C++ standard library. Notably their 10x-ness is in the performance of their code and not their performance on the job. Like you described.
> I suspect a lot more code gets written by junior developers than we'd like to think.
This may be true if you just measure lines of code. But if you couple that measure with the number of times each line was actually executed I suspect you'd see a different story. My library, for example, was comparable in size to parts of the standard library it replaced. So by direct measure a junior developer wrote half the code. But when you measure it by usage you can see the magnificent results of the 10x programmers at Boost and otherwise working on the C++ standard library. Notably their 10x-ness is in the performance of their code and not their performance on the job. Like you described.