2

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?

closed as off-topic by ozz, user40980, James McLeod, amon, Reactgular Jan 30 '14 at 16:59

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking career or education advice are off topic here. They are only meaningful to the asker and do not generate lasting value for the broader community. Furthermore, in most cases, any answer is going to be a subjective opinion that may not take into account all the nuances of a (your) particular circumstance." – ozz, Community, James McLeod, amon, Reactgular
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Whenever you see some clever piece of code odds are the programmer before you got to that point by fixing bugs in some not-so-clever code previously and learning from their mistakes. – Mike Jan 30 '14 at 16:26
  • Do not confuse source code efficiency with intelligence. Code efficiency has a limit, once reached the source code can not be made more effective. That is a limit imposed by the programming language. A stupid person can write highly effective code that outputs bad results. A highly intelligent person with a Ph.D in a subject with little experience in programming can write poorly structured code that outputs truly brilliant results. Writing effective code will come on it's own with time. Assuming that a programmer's intelligence can be measured by how effective their code is completely wrong. – Reactgular Jan 30 '14 at 17:11
  • You might also consider that just because you can write clever code and use language features, does not mean that is the right choice, or the best choice. You want others to be able to read, and understand code that you write. – ChuckCottrill Jan 30 '14 at 17:32
6

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
    Have a go at implementing the things you don't think you could! – Andy Hunt Jan 30 '14 at 16:36
1

Understand the basic constructs of programming languages, and design patterns.

  1. If you know how core things like declaration/initialization, loops, conditional statements, IO, etc you can pick up any language and 'work with' it.

  2. 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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.