GoldBorder Title GoldBorder Title
Programming: Lesson 2, Block Types
"A block can be defined by both its Label and Size/Type."

In programming languages, the most common way to define a block is to define it in the following order:

    [Size/Type] [Label]
This means the computer wants to know what size/type a block is, and then what you want to call it.

Going by Lesson 1's example, we would ask the computer for these blocks:

  • Large/Cool Cookies
  • Medium/Cold Ice
  • Small/Hot Fries

You will first be shown how to program in a programming language called JavaScript. There are many benefits to this language, especially for new programmers, which include:

  • free to make/use (i.e. you don't need to buy a product to turn your code into a program)
  • insertable into web pages
  • handles most of the work with variable Sizes and Types

The best beneift of JavaScript as a beginning programmer is that it will handle the Size/Type work for you.

I will still explain basics of block Size/Types below, but, beyond knowing about it, you won't have to worry much about deciding on how to create the blocks.

First, let's talk about the Size/Type of blocks. There are a lot of ways to define blocks.

This may seem overwhelming, but, there are only two types of blocks you should know to begin programming.

  • numbers
  • text

    Number Blocks are one of the easiest to create as the Size is pre-defined. This means you only need to worry about what Type of number block you wish to create. Number Blocks are used for tasks involving math.

    There are two (most common) numbers used by programmers:

    • Integers: a whole number, like 1, 25, 1458
    • Floating Point: a number with a decimal point, like: 3.5, 34.97, 2389.382

    Text Blocks are ones that that contain any characters, including numbers. However, Text Blocks are not used for math tasks.

    • Text Blocks: character(s), like "abc", "GB love's cookies", "2 bears and 1 baby"