Skip to content

Latest commit

 

History

History

3-understanding-programs

Understanding Programs

It's not enough just to know the language features in JS. Before you can write good programs you need to learn how to understand code that you did not write.

At first this might not sound right, but it makes sense if you think about it. It will usually take you at least 20 minutes (usually much more) to write a program. In that time you will write, delete, rewrite, and change your code many times. You'll forget what you wrote, or you'll remember something from 10 minutes ago but not the most recent code.

All this means that you can't rely on your memory to understand everything going on in your program (even professional developers can't do this!). Instead you need to learn how to read and understand your own code so you can figure out what's happening when something goes wrong.

So how can you practice this? By reading and understanding code someone else wrote. If you can understand their code, hopefully you can understand your own!