Google

Monday, February 05, 2007

Problems with learning to code through code reuse

I've come to the conclusion that while code reuse is a great thing to speed up development. It does not allow developers who are trying to learn a new skill to truly learn that skill.

An example would be that developers are continuously using String objects instead of StringBuilder objects when doing multiple concatenations and modifications. They have no idea why their code runs slow. You can't learn something if you don't take the time to understand it. So a lot of beginners do not know why StringBuilder is better than a String, or that in some cases just the opposite can be true, or what to look for on deciding which one to use. Some even have no idea on what immutable means.

There appears to be some disconnect these days with users who don't care to learn the basics. Part of this is due to the fact that you can build something with .NET so easy, and you don't have to know the inner workings. I find this very disheartening. Everyone wants short cuts but when you bypass this information your only setting yourself up for disaster.

So, with that I have a few suggestions for the individual who wants to know more about .NET. Start with the CLR and learn what it is and how your code is really compiled and what MSIL is. Learn about the Garbage Collector. Learn what the JIT compiler is. Learn what mutable and immutable types are. Understand why "for" loops are better than "foreach" loops. Know what pass by reference is.

This list is by no means complete but should be a good place to start. Enjoy and good luck.

3 comments:

Anonymous said...

I'm glad that I know what most of the things you listed are and at least a few details about them and their general purposes/meanings. As an example of the idea of avoiding code reuse in order to learn better, I had to hand code several sites in Ajax before I could bring myself to utilize any of the Ajax frameworks out there. And I'm glad I did because now, while I appreciate the ease of use that many of the Ajax frameworks out there provide, I have at least a slight understanding of what is going on in the background and why.

Thanks!
Mark

Anonymous said...

Not a bad idea.

Webplore said...

Good one keep uploading such type of things will return to read your blog...