Originally posted on WSOL.Com
Our civilization is built upon the foundations that were laid down long ago. Once we find something that works, we tend to emulate it in order to move forward. The world of web development is no different. In fact, it is probably worse. We steal borrow code all of the time. If we run into a problem, there is a good chance that someone has posted a solution somewhere on the internet, and our google-fu is strong.
Better understanding of what is going on
By re-typing the code, you start to get into the mind set of the person who solved the problem. And after all, isn’t that why you are there in the first place? To learn and understand? You start to see the patterns of good code, and recognizing bad code. And with better understanding, comes more intelligent observations, questions, and your own ideas on how to take it another step forward. I can’t tell you how many times something has “clicked”, and I understand something that had been eluding me to that point.
Muscle Memory
Don’t laugh at this one, it’s important. Raise your hand if you took typing in school. (Ok, guess I am showing my age. How about keyboarding, they still teach that, right?) What was the main thing you did during those classes? That’s right, copy text. That’s how you learned to type. How your fingers figured out where the keys were to make coherent words, without you having to go through the ‘hunt and peck’ torture routine.
Re-typing code is the same thing. Your fingers will get used to the routine of typing. Certain key combinations will become much easier, almost second nature.That, along with a better understanding of what the code is doing will help your coding speed improve dramatically. I promise.
Better Troubleshooting Through Typos
Don’t you just hate typos? There is nothing worse than spending half an hour to find that one command that had an “e” instead of an “i”, or that missing semi-colon. (Ok, there are a lot of things that are worse than that, but very few more frustrating. [Ok, there are many things more frustrating, but I think you get my point]) It’s funny, but finding those typos really does make you a better troubleshooter. It helps you recognize broken patterns in the code, which helps you understand what is going on even more.
Incremental Testing
Building an application, a web page, or anything else really is a pretty cool thing. Watching the pieces come together to make the whole is almost magical at times. When you are re-typing, you can test throughout the process. Find out what that last bit code did, and see it in action. Or watch the whole thing crash, and start the troubleshooting process knowing that it is easier to check ten lines of code than it is one-hundred.
So the next time you find that perfect code solution online, don’t just copy and paste it into your page, take the time to actually type it out. Obviously, project deadlines, client site development, troubleshooting, etc., don’t always allow us the luxury of retyping code, but when possible, the benefits are pretty great. You will find yourself a better programmer for it.
Very interesting post, Jaytem. “Don’t just copy and paste it into your page, take the time to actually type it out.” It’s a great point for all the reasons you stated. I’d add that developers who tend to “pump and dump” (that’s what I’ve labeled the process of copy/pasting code in a mad rush to meet a deadline without any consideration for what the code is actually doing) would benefit greatly from this. Just say “no” to CPDD (copy/paste driven development)!
Thanks for the feedback Bill. Unfortunately, sometimes you have to do the “pump and dump” (I love that term) to make a deadline. But you often pay for it later on, when you have to troubleshoot, and figure out what might be going wrong.
Nice Post Joe!
Thanks Chris. I had a lot of fun writing it.