And yes I'm afraid that the code which I will write it will not going to be good enough
It definitely, certainly, for sure will not be good enough.
It won't be good enough until:
- After you've finished writing it
- After you've reviewed it
- After you've tested it
- After someone else has reviewed it
- After someone else has tested it
Don't expect the code to work i.e. to run before you've finished it.
Nevertheless learn how to test it often so that you can develop it incrementally.
I'm looking for some of your experience and how you got over this
It helps to know what the acceptance criteria are.
In my first job, they had complete automated system tests for the software. My changes had to pass regression testing, and pass new tests (which were written by someone else) which tested that I'd fixed whatever bug or implemented whatever new feature I was supposed to.
In a later job as team-lead I knew I had vast advantage over new hires (more experience in general and more experience with 'this'/'our' software) and didn't expect them to be my equal. I wanted them to learn to work well, e.g. to finish and test their changes before submitting it; and to learn the right balance between reading the code to figure it out for themselves, versus asking questions about the code and about the requirements and about the process.
After six months or a year (after being hired and of being mentored on demand), the best ones among the new hires would be relatively independent (i.e. no more dependent on their team-mates than the other more senior programmers).
If you're lucky, someone (e.g. whoever wrote it) is available and can tell you how to implement what you're supposed to, i.e. walk through the source with you and tell you (orally) what you need to change and where. That can save you a lot of time.
I cannot breath like that guy writes code
It probably took him a while (to write it and to learn to write it). To catch up, you have to start.
If you're working full-time that's abut 2000 hours/year, so...
How to overcome anxiety when writing code
Some famous advice from 1975 was, "build a system to throw away, for even the best planning is not so omniscient as to get it right the first time".
Then, "throw one away" meant "write a whole system, throw it way, write another".
The modern way is to "refactor" which means "write a whole system, and then change/evolve it to make it better".
Another adage (this one is much less famous, I read it in Systemantics) is "A complex system that works is invariably found to have evolved from a simple system that works.
A complex system designed from scratch never works and cannot be patched up to make it work. You have to start over, beginning with a working simple system."
It's like, imagine your software is a human being: how do you write a fully-capable adult human? How do you even start? An answer is, you start by writing a baby.