Do not copy and paste code when you're trying to learn
Always type it out
11–20 of 184 posts
Do not copy and paste code when you're trying to learn
Always type it out
To be fair the case I am imagining myself in is the times I have looked up something relatively simple like opening a socket or something pretty mundane, so this may not apply to all situations.
This is so true. After 20 years, I've recently switched from csh to bash (so I can use rvm), and I've been applying this neuro-hack to less-used command. When you copy-and-paste, there's a kind of finger-learning that you miss out on.
Learning to play a guitar, for example, is difficult and yet crazily creative for this reason. It is (almost) completely behind finger-learning and thus in many original forms each with a signature of the individual who created the piece.
Don't have time today to provide citation but I believe the act of writing and transcribing involves a different part of the brain than reading...this is my layman's theory as to why writing and reading is so much more stimulating than just reading, even when you can easily comprehend the code on sight
Even more important is to go over every line and don't go on to the next line until you are sure you understand. Just like you can read without understanding you can type without understanding as well. Forcing yourself to understand will make you a much better programmer.
Even more important is to go over every line and don't go on to the next line until you are sure you understand. Just like you can read without understanding you can type without understanding as well. Forcing yourself to understand will make you a much better programmer.
Well, in one sense, I agree. Make sure you know what each line does on its own. But sometimes a single line doesn't make sense, in a larger sense, without something that comes later. So you have to have some tolerance for not understanding each line before you move to the next. It could be put in terms of knowing the "what" vs letting the "why" be uncertain a while.