When working on projects, it’s fairly easy to find a solution when you get stuck. Maybe you want to add this cool effect using CSS but have no idea how to implement it. Maybe you want a specific layout and don’t know how to order your HTML file. Or maybe you don’t know how to write a specific algorithm that you need in javascript.
When stuck, your answer is just a google search away, and chances are, especially if you’re a beginner and just starting out, people will have already asked the specific question that you need to be answered. Stack Overflow, Reddit, the countless of programming blogs out there, you’ll eventually be able to find what you’re looking for. But when you do, DO NOT COPY AND PASTE THE CODE when you don’t understand it.
Sure you get a solution to something you’ve been stuck on for the past week. You may be cranky and tired and just over everything so finally knowing how to do it can be a gift straight from heaven. But, no matter how you feel, you can’t copy paste it.
Copying and pasting while not understanding the code can only lead you on a road to failure. Sure, it’ll work, but you won’t learn anything from it, debugging will be a nightmare, and you won’t be able to create it on your own and next time you run into the same problem you’ll have to google it again.
There’s nothing wrong with copying someone’s code, but whenever you do so, make sure you understand the ins and outs of it. Experiment. What would happen should ‘x’ change? Will doing ‘y’ a different way provide the same result?
The only way to profit and learn when copying someone else’s code is when you understand exactly what’s happening.