4. Variables

Think about what variable means in math. If you’ve done a little algebra, you’re probably thinking of a letter that represents some number. The benefit of using a variable is that you can work with the letter without having to know what the number is. You might be able to figure out what the number is, but in many cases, you don’t need to think about it. The letter representing a number is an abstraction. A value (a hard number) can be represented by a letter or a name, and then you don’t have to think about the details of what the number is. If you know, for instance, that x < 6, you don’t have to know exactly what x is. All you need to know is that x is less than 6. The details beyond that don’t matter. It’s no longer just a number; ...

Get Learning MIT App Inventor: A Hands-On Guide to Building Your Own Android Apps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.