[Opinion] Do not just imitate, but instead understand!
So you are doing some form of training?
Whether you are watching a coding course online or sitting in a lecture, you need to understand what is going on.
Copying VS Understanding
A lot of people just look at examples and copy them. However this can get you stuck a lot of times, and can end up backfiring for you. What happens when you hit an issue that you haven’t ever copied before? Instead of just taking whatever the training course gives you at face value, dig deeper!
You will learn more and be better at what you are training for if you do. If you are wondering how you can go deeper here are a few suggestions.
One.
Instead of just copy and pasting an example type it out. Line by line. As you do so try and understand why they did what they did. This not only gives you insight into actually writing the code but might result in miss types. You’ll get bugs and have to figure out why it isn’t working. Problem solving and troubleshooting a program can often times teach you so much more about what you are writing that just reading or copy pasting.
Two.
When you read through some code, try to close the book and type out the parts from memory. This not only helps you learn the code blocks but you’ll also be able to create you own coding style as you aren’t verbatim copying code.
Three.
Try it another way. Just what it says, you look at a block of code to copy and figure out what it is doing. Then you try to come up with a different algorithm or method of getting the same answer. You may not have the most efficient result from it, but it will help you learn the concepts of why they did it the way they did.
Four.
Ask Questions. If you have a community forum or are live or in person with the speaker then ask questions. Ask them why they did things certain ways, and if there are other better ways to do them. Ask for deeper clarification on terms and usage.
Conclusion
I can only rehash it so many times, but please for the sake of your learning and the future of software development… Please take time to actually learn what you are seeing.