There is one single factor that directly addresses coding speed.
The coder knowing what they are doing.
I'm not talking about "good coders" vs "bad coders", I'm talking about a coder who knows exactly what they want to do, and the only thing between now and having it done is the act of coding.
If you're guessing, "figuring something out", "not sure", etc., all of those slow your programming down to a screeching halt as you're always doing false starts and testing and retesting.
Now, you can "know what you're doing" and still have bugs. First, you could be dead wrong on your code. Second, you may have simply missed something, a simple typo, or whatever.
If it's the first, and you're just completely wrong, then that can bring your coding to a smashing halt, as you may have to throw it all away and rethink it and approach again. But if it's just simple routine bugs that are the nature of transcription, then those don't derail the process.
The farther you can look ahead of the problem and keep "on course", the faster you can code.
Many folks simply do not code this way. Rather, they use the code and tools as a canvas to "try things out", or get a "feel" for the system, or whatever.
These people do not "know" what they're doing.
It's kind of like shopping vs buying.
When you have your shopping list, going to the grocery store can be quick and efficient. You go in, follow your list, check 'em off, and out the door. That's "buying".
But if you're wandering up and down each isle, deciding what you want to eat that week, "Oh look! Cap'n Crunch is on sale" etc., then the process slows down. This is "shopping".
Everyone shops, everyone looks around. All coders must go through this "shopping" process to figure out what they're going to do. The classic "write it once, throw it away, write again" is a shopping process.
"I don't know what's wrong with what I'm going to do until I do it." When every line of code is a potential minefield, you tread lightly and slowly.
But once you've been down the path, when the mines are marked, you can code very quickly.
Some people can arrive at "knowing what they're doing" faster than others. Some folks may complain about some programmer using unsophisticated techniques, but even with "less efficient" paradigms, the programmer can get code out faster than others. His palette may be smaller, so he "knows what he's doing" faster.
Everything else is simply noise in the process. You can have the best working environment, with the comfiest chair, and whatever, but still be a slow coder if you have difficulty arriving at what you want to do.
In the end, speed does not necessarily make someone a better programmer than another. It just makes them faster. For limited domains, this is effective, but it's not a universal truth. Experience tends to give the programmer more foundation upon which they can make these decisions, they can use experience to throw out a lot of "bad ideas". This can make them faster.
On the other hand, there's some value of watching novices charge off in to the light, blindly missing all of the caveats, bumps, and other things the experience folk think may be lurking around each corner. The "what abouts" that plague all of our decisions and turn a simple CRUD screen in to some over engineered horror "just in case".