The other day I posted a couple of links for learning NodeJS. I was wondering, what is the best way to maximize my knowledge?
If I just copy paste code from online tutorials, I feel like, I won't be able to write them myself if I had to start again without googling?
Say for example, if I follow some tutorial, how do I ensure, I can code everything from that tutorial without looking up online for code snippets?
It's nice to copy and paste but it's better to understand what you copy and paste. Try to read it and understand it, and try to make laster something by yourself.
Coding is a long term process. And no one can become a programmer over night. It's something like that for me e.g. You want to build a home. First, make a strong foundation (Basic Programming) which become the base of your coding life. Then start making floor (OOPs and Loops). Then make the strong ceiling of your home (Advance Programming). Now it's time for interior design (Follow influence coder and try to break coding). This is my personal experience. No matter if you copy or paste the code from online sources. You should understand the working of the code.
This really depends on the exercise/ how it's being taught. If the lesson begins with a starter code and then has a number of tasks you need to do to complete the piece, then by all means type it out. However, if you are being given a large file that does what it needs to, then typing it out might not be effective.
You're learning the process of building something. Start with the foundation and work up. Learn how to read the code and what each line does. Ask yourself if you could build the project on your own up to where the tutorial is without using the tut as a resource. If you can, great! Do it yourself and use the tut to guide you to what to do next.
That's an ineffective approach to learning. The material won't stick.
It's okay.
I prefer typing it myself if it is very little code (for introductory tutorials it usually is, for domain-specific ones it varies), because I have more time to think about it. Never copy without understanding it, it's a very common mistake I see in rookies code.
If you think you understood, then there's the more tricky part. You have to question yourself if you really understood; this is especially important if it seems trivial, because, I've found out, that there's some sort of bias where I tend to conflate true understanding with whatever I think is common sense. Therefore if you find yourself in the situation where you learn something you had no previous knowledge about easy, test your newly acquired knowledge by modifying the problem with some hypothetical new requirement or constraint and try to solve that—it doesn't really matter that your current need doesn't involve said new requirement or constraint. It doesn't matter if you copy/paste the code, it's the semantics that matter not the syntax.
As someone who is currently learning web development I can say I learn more by typing in the code vs. copying and pasting. Here are a few benefits I find from typing vs. copying and pasting.
You learn the proper formatting of the code. Where to put the brackets, semicolon, spaces, etc. You want to understand what the code does, of course, but proper syntax and formatting is going to be equally important, especially if you collaborate with others.
You get to know the ins and outs of your IDE of choice better. Simple example, if I'm creating an HTML file I use Sublime Text. I could copy and paste in the declaration info., etc. However in Sublime if I have an html file I can type in html and hit Tab and get all that info.
I personally just learn better by repetition. If you keep typing the same thing, you will eventually learn it.
I remember what I'm learning much better when I type it over and over again until I have it memorized. To take it a step further, I find writing it on a whiteboard works even better.
Well, I can give you insight how I tend to learn and what works for me.
Whether it's video tutorial or not, I look at it few times in a row to get bigger picture of how is something supposed to work. I don't dive into details immediately. I simply want to understand.
To google is perfectly okay, remember this! You can't memorize everything, and you should not. If you start preferring one framework over another you will get used to it, and you will code some parts without googling it, but you should never force yourself to remember things. It will come naturally if you are persistent with your technology stack.
BUT, I think you should always seek to understand, that's quite another. The more you use technology the better understanding you will have. You can't really understand it unless you use it.
Just be playful, that's it. Kids are very good at learning, you know that. They learn language very fast, they grow in every single way, because they are not afraid to explore. They take it as a joy, and so should you :-)
I think it's okay to copy and paste from a tutorial if you know what's happening and how to build it on your own! An example:
Learning node.js you'll often have this first step of creating a server.js. Maybe this is your fourth "Let's build XYZ with Node.js" tutorial and you already understand all the bits of that code and why everything where it is. So now it's absolutely okay to copy and paste.
But if you think omg what's going on there?! Learn the basics. You won't get anything from that tutorial if you just copy and paste.
I think the biggest problem with that tutorials is that people with just a minimal knowledge of javascript really think they'll understand Node.js with one or tutorials on how to build a Todo App.
At first you should know what does a server do? How and why they respond the way they do? What are the key things in Express and why is everybody using it?
And after you got this basics in your head: it doesn't matter that much how the code exactly looks – so go on and copy that stuff.
Matti
UI Designer & Webdeveloper
Connor McKelvey
Javascript Developer
If typing is preventing you from learning then you should definitely practice. After I learned HTML and CSS I copy and pasted my way through JavaScript and Joubert for a long time. If I had invested the time to actually retype the code from the tutorial it really would have helped me learn faster.
Retyping code fro tutorials does many things. First of all, like taking notes in class typing it yourself helps you remember what is happening I your code. This makes refactoring and debugging 100 times easier. And second it helps you learn how to format code properly. Lots of editors do auto formatting for you but they aren't great with everything. So learning how to quickly get your code looking clean in a a big gain.