Syntax and the building blocks of a programming language
Just as human languages have grammar to dictate the rules of the language, a programming language has syntax. The syntax is the rules for how we write a program using a language. There is one big difference between grammar and syntax and that is about forgiveness for errors. If you meet someone who speaks your native language but makes some errors here and there, you will still be able to understand what that person is trying to communicate to you. That is not the case for the syntax of a programming language. It does not forgive at all, and you will need to get it spot on:
As we discussed earlier, the code we write will be translated by either a compiler or an interpreter, and for that translation to work, the syntax must be flawless.
Each programming language has its own syntax rules, but as we saw in the family tree earlier...