Home 05: Organizing your code
Content
Cancel

05: Organizing your code

Now that you use variables we should talk about the structure of your code again. You can define and use variables everywhere inside your code. But it‘s a common pattern to define the important variables that you use throughout your code at the beginning of your file. This way you can easily see which variables you are using.

Commenting out code

You remember that we talked about commenting out code. It is sometimes useful to just comment out a line where you add, subtract, divide or multiply something to see if the outcome is as you expect it. When you comment out a line of code (or multiples) and you are using the p5canvas extension, it will automatically update.

This post is licensed under CC BY 4.0 by the author.
Contents