| This article has links to websites or programs outside of Scratch and Wikipedia. Remember to stay safe while using the internet as we cannot guarantee the safety of other websites. |
Block-based coding, also known as block based-programming, a type of programming language where instructions are mainly represented as blocks. Scratch is a block-based programming language.
Scratch as a Block-Based Programming Language
Scratch uses blocks to represent its scripts, like the following:
when gf clicked say [Hello World!]
While "say" and "hello world!" are not blocks, but text, the language counts as block-based because it is mainly oriented around blocks. However, Tosh, which is a language like Scratch but completely typed, is not block-based, but instead text-based.
Text-Based Languages
If a language does not involve blocks as a main part of its programming language, but instead is mostly oriented around text, then it is known as a text-based language.
Advantages and Disadvantages
Block-based languages have both advantages and disadvantages compared to text-based languages. Block-based languages tend to have a palette of commands to choose from, making memorizing commands less necessary and making it easier for beginners to program. Additionally, block-based programming languages have the advantage of lacking syntax errors. Syntax errors occur when the formatting or structure of some piece of code is not valid. Syntax errors regularly occur in text-based programming languages; however, such errors theoretically cannot exist in block-based languages as the blocks cannot be changed or modified to result in an erroneous outcome. However, block-based programs slower to create. This is because block-based programming usually requires blocks to be dragged around to create or modify code, which is slower than modifying code on a keyboard.
Examples
Languages that are text based include:
Languages that are block-based include: