
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.
Table of Contents
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.
What Is a Syntax Error?
A syntax error is a mistake in the grammar of the code, and the program will not run until it is fixed. It usually comes from something tiny: a missing bracket, a forgotten quotation mark, a colon in the wrong place, or a misspelled keyword. When this happens, the language stops and points to the line where it got confused, which is actually helpful because it tells you where to look. Syntax errors are the most common errors beginners meet, and the good news is they are the easiest to fix once you learn to read the message. Block-based tools like Scratch avoid them entirely, because the blocks only connect the correct way.
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.