I have moved to a new job and code base (been doing C#, .NET, Windows Forms, etc. for last four years) and I have been on this for three months until today. During these three months I caught up with parts of the language and syntax that I didn’t know before (MVVM, Silverlight, some advanced stuff in .NET like Action, Func, Callbacks, etc.), so now I know those but still when I go in the code to fix a bug and see their code, I get disappointed, because I see some coding techniques that although I know the syntax and understand it but I think to myself “could I write this myself”?
The answer is no. For example they create classes that have a member as “Action” and at run-time they assign actions to separate instances, or register – unregister events at some parts of the code, etc.
Is it normal? and gets better by time? or I am just a stupid mediocre developer? and how can I make it better?
3
Practice, practice, practice.
Also, don’t assume you know the language. The fact that you’re surprised to see someone register and unregister events shows that you have still things to learn about the language. The fact that you’re surprised to see Actions in action indicates that you also have things to learn in .NET Framework.
Is it normal?
Totally. You become expert in a field after ten years of practice, and even after that, you have still things to learn.
Or am I just a stupid mediocre developer?
The fact that more experienced colleagues are doing things you don’t know how to do doesn’t mean that you’re mediocre. They know the stuff better, because they are more experienced. You’ll gain the same experience with time.
Having more experienced colleagues is also an excellent thing: you can learn from them a lot. Take this as an opportunity.
How do I practice?
By doing four things:
- Reading code of others, and inspecting the parts you don’t understand; if you’re stuck, ask your colleagues—the ones who originally wrote the code.
- Writing code: you can’t learn something if you don’t practice that.
- Reading your own code you wrote months ago, looking for things you may have written differently. If the problem is sufficiently complex (and you still remember it), you could even rewrite that code using what you’ve learned since then. Doing that allows you to learn how to write code using the improved techniques you’ve learned, without getting bogged down in learning about the problem domain.
- Asking more experienced colleagues to review your code, and to make constructive criticism.
1
Understand the basic constructs of programming languages, and design patterns.
-
If you know how core things like declaration/initialization, loops, conditional statements, IO, etc you can pick up any language and ‘work with’ it.
-
Moving further (and as per your example) if you know design patterns well you can write efficient code in less time in any modern language like java or c#. So try going for the GOF design patterns book. This way you can ‘master’ the language.
If you know the constructs and the patterns, the rest is just syntax that you can look up in the reference library while coding. Looking at reference docs will be a bit slow in the beginning but once you have coded in a language for 2-3 years you will no longer need to look up the reference docs.