
Coding Education
What Is Syntax in Programming: Rules for Writing Code

Bayu Nugraha
Children's Coding Specialist

In programming, syntax is the set of grammar rules of a programming language — the arrangement of symbols, keywords, and punctuation that must be written correctly so the computer can understand and run the code. Just as English has grammar rules, every programming language has its own syntax.
Syntax Examples
Syntax governs small but important things: where to place a colon, brackets, quotation marks, or spaces. For example, in Python, to show text on the screen a child writes print("Hello") — the keyword print, then an opening bracket, the text inside quotation marks, and a closing bracket. If one of those marks is missing, such as print("Hello" without a closing bracket, the computer refuses to run the code and shows a syntax error. In Scratch, syntax is easier because it uses blocks that only fit together the correct way — those block shapes are what prevent syntax errors. In fact, syntax errors are the most common type of error beginners meet, and are almost always caused by a single wrong or missing punctuation mark.
Why It Matters for Kids
Learning syntax trains children to be precise and pay attention to detail — one missing bracket can make an entire program fail. In the Algonova coding course, kids start with Scratch, which is free of syntax errors, then move up to Python where they learn to write code by the correct rules. Understanding syntax also helps children spot and fix bugs in their own code faster.
Want your child to write their first line of code? Try a free coding class and see syntax work firsthand.
