SandCastleIcon.png 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

Both text-based and block-based languages have certain advantages and disadvantages. Block-based languages tend to have a palette of commands to choose from, making memorizing commands unneeded or less necessary, which makes it easier for beginners to program. However, this makes block-based programming slower and potentially more limited due a lesser degree of complexity behind the coding, as well as harder to edit (for example, changing a plus to a minus). Block-based programming languages also have the advantage of lacking syntax errors. Syntax errors occur when the sequence or specific character/set of characters in a command are placed incorrectly. Syntax errors are regular in text-based programming languages, however, occurences such as these essentially cannot exist in block-based languages since the blocks cannot be changed or modified to result in an erroneous outcome.

Examples

Languages that are text based include:

Languages that are block-based include:

See Also

Cookies help us deliver our services. By using our services, you agree to our use of cookies.