What do computers, cooking, and math all have in common? Well, recipes for one thing! There are ways of working or rules that need to be followed in all three areas. In cooking, you use recipes. Computer programmers and math students use rules or “recipes” too. If you don’t follow the rules, then disaster is inevitable!
Figuring the Facts
In mathematics and computer programming, there are rules to clarify which procedures or operations should be performed first, and these rules are the same for both subjects! A math student thinks of these rules as the order of operations, but a computer programmer calls these rules operator precedence.
Just as a chef uses a recipe, operator precedence is a recipe that a computer programmer uses. If the programmer follows the rules of operator precedence when writing a computer program, then he or she can make the computer complete desired tasks.
If you listen to how Larry Wall describes the basics of computer programming, you will be able to draw even more connections between cooking and computers! See for yourself:
Check out the websites below to find out how you can start learning the basics of computer programming.