Scratch vs. Processing

Comparison: Scratch vs. Processing

There are many similarities between the two languages; in fact, these similarities occur across nearly all of the programming languages in use today! Nearly all programming languages are equivalent in terms of being able to express any algorithm.

Scratch Processing

To get you started seeing how familiar Processing should already be, here are few examples of how Scratch and Processing compare with one another:

  • Each has buttons that start and stop the execution of a program.
Scratch Processing
  • Each has a way of outputting text.
Scratch Processing
println("Hello!”);
  • The conditional statements look similar:
    1. The keywords are the same: if and else.
    2. if comes before else.
    3. else is optional.
    4. There is a “hole” where the condition to decide upon is placed (e.g., parentheses).
    5. The contingent blocks of statements are packaged in a structure (e.g., braces).
Scratch Processing
if ( SOMETHING )
{
   DO THIS...
}
else
{
   DO THAT...
}
  • Each offers a way to assign a value to a variable.
Scratch Processing
index = 0;
  • Each offers a way to change the value of a variable.
Scratch Processing
index = index + 1;
  • Each offers a way to repeat an action. Note that Scratch uses a “repeat until...” metaphor, while Processing uses a “repeat while...” metaphor. This difference means that the Boolean conditions that determine whether to repeat another iteration of the loop are opposite one another:

    • Scratch: The loop continues until a condition becomes true.
      • repeat until x < y (i.e., x is less than y)
    • Processing: The loop contines while a condition remains true.
      • while x >= y (i.e., x is NOT less than y)
Scratch Processing
while (x >= y)
{
   DO THIS...
}