Total Pageviews

Thursday, 24 March 2016

Learning to Code by Writing, not Copying

"Yeh, If your a experianced coder, five mins no problem but if your a bigginer it can take hours." - Rowen Henderson8

"it would help a lot if you ppl would copy and paste the code into your videos on the bottom." - Emjay Club

"Fantastic but please add the script somewhere so we can download it... sorry too lazy to read from video and type it :)" mete kavruk

Often when I make a 5 minute video about computer programming, I don't include the code text file in the video description. Why not?

Give me the code!
Here are some common arguments:

  • Writing the code for your five minute video can take hours for beginners.
  • I just want my game to work now. Can't you help me?
  • Aren't you all about open source? Why isn't your code open source?
  • Something is wrong with the code I wrote, but I can't tell what it is. Can I have your code, to compare?

It Takes Me Hours!
So you say that it takes you hours to write code that I can write in a five minute video. Do you ever wonder why that is..? Programming isn't just about understanding the code that you see. You need to be able to write it. This includes physically typing on a keyboard. If you're having trouble writing my code, then that's the number one skill you should be working on. Working hard to copy my code is not a waste of time. You are learning a skill.

Using Autocomplete is a Skill
People tell me all the time that I type "super fast" in my videos. Well I don't. I use autocomplete! Using autocomplete is a skill. If I need to type "gameObject.transform.position;" I'm actually typing ";". And if autocomplete isn't working... you know what that tells me? It means my code has a problem and I need to fix it right now!

Okay, I do also type very fast.

Usually when autocomplete stops working, people keep writing code. No! Things are just going to get worse and worse from there. The only "broken" line of code should be the one you're writing.

I've also seen students confuse semi colons and colons (";" and ":") or struggle to find inequality signs on the keyboard (like ">" and "<"). If you want to make games at any level you need to master the keyboard. Have a look at the very first comment in this blog post by Rowen:

"Yeh, If your a experianced coder, five mins no problem but if your a bigginer it can take hours." - Rowen Henderson8

Do you think he has mastered typing? Maybe English is not their first language. In that case, they're not using their browser's autocomplete (spellcheck) feature. I guarantee these are the skills they need to work on most in their journey to make their dream game.

Following Tutorials is a Skill
When I follow tutorials, I don't copy code exactly. Maybe you've had a tutorial before that told you to write:

print('hello world')

but instead you wrote:

print('hello capybara!')

This too is an important skill. You can learn more from a programming lesson if you make personal changes too. This develops your skills because later on when there's an error in your project, you need to decide if it's a problem with your personal changes, or a problem with how you copied the tutorial, or a problem with the tutorial itself. You need to learn how to be cautious when personalizing a tutorial.

If you just copy a script, it's very natural to do zero tinkering.

Aren't You All About Open Source?
Yes. One of the wonderful things about open source is that anyone can copy a project, learn from it, or help make it better. The thing is, I don't care if people can copy a project that I wrote in five minutes. And my viewers can't really make my code better... or else I'd have to make a new video (making videos takes a long time!). This brings me to:

Why Do I Make Tutorials?
I feel that most people are technology illiterate. New technologies don't take off, and research doesn't get funded because investors are tech-illiterate. Governments openly discuss banning encryption or eliminating our privacy because voters are tech-illiterate. Businesses don't join the community of free and open source software as often because their employees are tech-illiterate. Public funds are wasted because government committee members are tech-illiterate.

Technology illiteracy threatens democracy, it's hugely wasteful, and it's a huge pain in the ass personally in my day to day life. Making videos and not sharing my code snippets is my way of getting people to think computationally, pay attention to detail, and become literate.

Whatever... So When Can I Get Your Code?
Okay fine! I do sometimes share my code. For example in my portal gun video, I decided the scripts were too long to copy. Copying them from the video wouldn't be a good use of a learner's time so I shared them in the video description.

Finally, I do have a Patreon page. If you like my content, you can give me a dollar, or any amount, for every video I post. Supporters have the option of downloading all the scripts in my videos.

Pedagogically, I don't like this option so much. But I decided to give subscribers the option as an incentive to help support the creation of more videos. The more I get paid to make videos, the less often I need to take other small contracts.


  1. Amen. As a student, I always push peers to think critically when helping them solve coding problems, rather than giving them a solution verbatim. I step them through the same sort of problem-solving and design processes that happen instinctively in my head.

    Rather than rattling off answers or tips, I think its healthy to have students make blunders or get stuck for a little. The process of debugging and correction helps both their self-efficacy (belief that they have the ability to do this whole "coding" thing) and their critical thinking skills. Sometimes I go so far as to have them open up Google, figure out a good search term, and browse through documentation and Stack Overflow to find the answer. It's amazing to me that some people need to be walked through this process.

    I think you hit the nail on the head with talk of "thinking computationally". Tech-illiteracy isn't so much the issue as the fact that people don't even have the right thinking skills to become tech-literate. I partially blame our education system, which should in the early years teach self-sufficiency, love of knowledge, and critical thinking rather than any specific knowledge-set.

  2. Good article. However I do have a counterpoint. Everyone has there strength's and faults. For me as far as game design goes, my strengths are in music composition/sound, artwork, and writing, level design, etc. Code is my weakest link.

    For some people it's the exact opposite, they can code literally anything but if you put a gun to their head and tried to force them to write a good song they simply could not do it, no matter how much time they spent learning how to do so.

    My point is while I agree you should understand the concepts behind what your trying to learn, sometimes there are people that don't want to spend those hours to get a working script simply becuase they flat out suck, and always will. You can't fight your nature, sometimes you just aren't good at something in the same way sometimes your just naturally good at something.

    I've been coding for three years in now, and only very recently have I started to be able to do things on my own without my few friends who are very talented at coding, but I still am by no means "a coder".

    I still get what your trying to do but I want to offer this other perspective that it's not always about tech illiteracy. Maybe in ten years I'll be a somewhat decent coder, but at that time I'll have been doing music for nearly 20 plus years and artwork for fifteen, so in comparison I think I'll feel the exact same way - I'll just want to focus on my strengths.