Most of the developers afraid of writing wrong code with incorrect variable naming, page format , coding without using design patterns....
I've been working with young coders and people comes from different disciplines to programming for many years. The first rule of keep them in coding is allow them code working correct code without syntax and refactoring their code.
When they see their codes run, It brought them self-confidence. After seeing working code telling such people usefulness of coding standards and design patterns etc.
It works, try this.
Work it work, write it work and write it fast* and so on
*https://www.quotemaster.org/qff20268b57265e7feba12ecd05ebdec2