What is a Syntax in Computer world?
In the current word we are mostly dependent on lots of electronic and electrical gadgets around us. Most of them runs on embedded software installed on their motherboard. Now the question should be how these software works? Let us explain this in detail.
In the Computer World each software runs on some kind of command, and parts of command referred as syntax. Syntax is nothing more then instructions specified in structured formats, also it can be referred as programming language that a software can understand.
For example, think of an language like Hindi, English or French etc. every language has specific characters and punctuation be used in the right way so that someone hearing or reading the words can understand them correctly. If somehow characters in the words are placed zigzag in a sentence, it will be very difficult to understand by someone.
Just like any language, the structure, or syntax, of a computer command must be coded or executed perfectly in order for it to be understood, with all the words, symbols, and other characters positioned in just the right way.
Why is Syntax Important?
Would you expect someone who reads and speaks only in Russian to understand Japanese? Or what about someone who only understands English, to be able to read words written in Italian?
Similarly, different programs (much like different languages) require different rules that must be followed so that the software (or person, with spoken language) can interpret your requests.
Syntax is an important concept to understand when working with computer commands because an inappropriate use of syntax will mean that a computer can't understand what it is that you're after.
Let's look at the ping command as an example of proper, and improper, syntax. The most common way that the ping command is used is by executing ping, followed by an IP address, like this:
ping 192.168.1.1
This syntax is 100% correct, and just because it is correct, the command-line interpreter like Command Prompt in Microsoft Windows, can understand that we want to check if computer can communicate with the specific device on the network or not.
However, the command will not work if we re-arrange the text like this:
192.168.1.1 ping
We are not using the right syntax here. Although command looks alike but it will not work, because computer has no idea how to handle this command.
Computer commands that have the wrong syntax are often said to have a syntax error, and will not run as intended until the syntax is corrected.
Every command has something different to do hence they are called different syntax. Just one rule to remember i.e. we have to follow certain rules that apply to how they can be used.
Hope this helps...