When a Better Coder Gets Hold of Your Code
I was lucky enough to have a great mentor when I got into front-end development. He was patient and didn't mind teaching me because I really wanted to learn. For some crazy reason he trusted me with tasks with which I didn't trust myself. Well. I'm not sure if he trusted me or just didn't have the time to maintain certain sites and decided to give them to me and take a chance. Either way, it was a great way to learn.
After I was actually hired onto his team, I was given more and more difficult tasks. And I grew in the challenges. I'd do what I could on the really difficult stuff and ask questions when I was stuck or finished (because I just wanted to know what I could have done better). It was not uncommon to come in to work and him say,"Hey, you know that thing you've been working on for the last couple of days? Well I rewrote it last night." It was a little odd because I wasn't offended by this. I felt more guilty that he felt that it needed to be rewritten and had to expend his time to redo something he delegated to me, but I wasn't offended.
The key was that he had 7 years on me in this industry and I valued his input. So, instead of licking my wounds, I took the opportunity to download what he did and see how he improved upon what I had done. I always looked at it as a learning opportunity. I would advise anyone, in a job where you can fine tune your skills, to latch on to someone who is better at your job. Analyze their work. Ask questions. Have them critique your work, don't take offense, and instead learn from their feedback. Otherwise, you're missing out.