Never Copy-paste Code as a Beginner
When you are a beginner, you probably watch hundreds of hours of tutorials. There is no problem with that; it’s a good way to start. The problem is when you remain in tutorial hell, and I believe part of tutorial hell is the copy-pasting of code.
As we grow up we learn a lot by copying others. And by copying here I mean recreating:
In school, we draw the same letters thousands of times. We not only learn letters but also improve our fine motor skills.
Copywriters type out famous marketing ads letter by letter to understand the flow and psychology behind them.
Basketball players analyze video and try to shadow the movement of LeBron James or Michael Jordan to find the nuances in their game.
Think about Copywriters. What would they learn if they only copy-paste (CTRL +c CTRL + v) the text of the ad from a platform to their notepad? If they read it maybe once then probably a little bit. But typing it out letter by letter is different.
I like the idea of NOT copy-pasting code as a beginner. Like handwriting, coding should not be about the working code itself. When you learn you must understand the nuances.
Consider the block above. It is simple but can be difficult to understand as a beginner. ChatGPT will write it for you in a sec, or you can copy-paste something from Stack Overflow.
But typing it out will add a new layer of details. I try to mimic what happens in my head if I type this line by line:
"Let’s define a function called reverse_string with one input ‘s’.
Start with an empty string result.For every character in the original string I want to do the following:
In the result, store the current character and the rest of the result. This way if I go one by one, the original string will be reversed by lopping through the whole string. After first iteration the result will contain e after the second it will contain eh and so on.
Then we need to return the result.
Let’s try it out with a print statement.
The expected output is olleh.”
By typing it and ‘discussing’ what I do in my head, I also described the logic of the code.
Whenever you watch a tutorial do not go to the GitHub repo and copy-paste the code. Write it out yourself, figure out the logic, or even try to improve it.
I like the idea of gamified learning, but it encourages you to rush through lessons. You set your daily goal to be high because you want to learn a lot every day. The result? You will rush through the lessons and collect points fast, but not achieve deep knowledge. You do more points for less knowledge. You should slow down. In the end, the winner is not the one who collects more points on the leaderboard, but the one with better knowledge.
Coding with AI as a beginner is another trap. It is super fast, you get working code in minutes, and you feel the fake reward for writing the code. When you try to do the same without AI you are stuck on line 1.
Since I use AI the first idea I have on a problem is not about the solution itself, but to how to phrase the prompt.
There is no issue with that if your only goal is working code. But if you want to understand code you need to slow down. I love coding because of the problem-solving and logical aspects of it. It is like a puzzle, you need to find the correct pieces to create the abstract. With AI, it started to fade. Copy-pasting is not puzzle-solving.
DO NOT stop using the methods above, but use them wisely. Whenever you use gamified learning remember the main goal: We are there for the knowledge and not for points. When coding with AI, spend a few more minutes on understanding the output and never copy-paste blindly.