It cannot be helped. If you’re a teacher, there will always be more to learn and there will almost always be at least one person in the room who knows more than you do about a particular subject.
If you teach modern computer programming skills, you’re likely teaching things that you’ve learned this month; maybe even this week. For everything you teach, there are ten relevant skills you don’t have that someone else in your class does.
People who work in computer programming generally understand that the complexity of the subject precludes anyone from having an authoritative grasp on all of it. As teachers, we can’t possibly teach the craft of programming: that comes from years of practice. Instead, we aim to teach students what this universe is made of so that they know how to ask good questions and how to be resourceful.
To put it in more basic terms: if you were left out in the woods and didn’t know that some plants are poisonous and others are ok to eat, you would have a much harder time surviving than someone who knows this difference exists; even if they didn’t yet know how to tell the difference between the two.
The key to teaching beginners and to becoming a master of a craft such as programming, is to understand the fundamentals and to be able to improvise based on those fundamentals. The successful computer programmer and the successful teacher must have the confidence that he or she knows enough of the basic fundamentals well enough, that learning new technologies is just a matter of learning a new tool.
New languages and technologies don’t need to be intimidating. They can be looked at as fresh ideas to be absorbed or ignored with whatever urgency or lack thereof, you choose. When you’re asked how to write something in a particular language or with a particular tool, your answer will often be “let me Google that.” The implementation details and syntax aren’t as important; what matters is understanding how to apply new information. Everything else can be Googled.
How do you get started on the road to mastery? Learn the fundamentals, take courses that teach you a little bit about everything, and then, practice. How do you get to the point where you feel calm in your lack of knowledge? Teach.