Hello, how are you? i’m well fine in this saturday, first i apologize if there is any mistake any help or knowledge would be nice. Resuming from my last article, last time we talk about Coding Variables, specifically Java Variables what a discussion we had last time eih?. Now, on this brightful day we will continue our discussion or talk for the #2 thing which is Coding Syntax. On the next article we’ll have a talk about Coding or Programming Algorithm.
Ok, does any of you recognize the word “Syntax”? well maybe some of you already know Syntax, which is the arrangement of words and phrases to create well-formed sentences in a language. It’s a good answer but we need to more specify it a little bit, in computer science Sytax always refers to the grammar and spelling of a Programming or Coding language, now I have gathered information and make a conclusion that Syntax is:
Syntax of programming language are the set of rules that define the combination of symbols in an exact form that the computer expects and considered to be correctly structured programs in that language itself . The expected form is called Syntax (in Computer Science, don’t get confused with general syntax).
In the definition above you’ll see some sentence like “correctly structured” and “symbol“, what does this means? let’s say it that syntax is a certain layout of words and symbols. for example, if you want to acces a certain web page what would you type in the address bar? let’s pretend that you type , www.webhostingallinone.com what would make you so sure that what you type would go to a web page instead to an email address? it’s because of the “www“(that stands for world wide web) and followed by a website domain “webhostingallinone.com” and because it is considered to be correctly structured to the internet and to a web. Well in programming language it’s just the same, there are rules that are set in place when you obey them you will make some kind of functioning program, but beware if you don’t follow the rules and placement, xO error pops up.
So, what about an example of a Syntax, well what about we use our last discussion as the base. In our last talk we make this Variable:
int first_number = 10;
There are 4 parts of Syntax that needs to be explained here. First, the “int“, this part stands for the Integer type of variable, remember the String, Integer and Double we talk last time? Integer are suppose to contain whole number, nothing else. Second, the “first_number“, this part stands for the name of the variable, a variable name could use word and numbers but the only special character it could contain is ( _ ) an underscores, usually in the Java world variable name front letter are lowercase letter, well they don’t have to but that is usually the kind of accepted and sugested convention(in Java world). Third, value “10″ (don’t mind the quotes), this part of the sytax is use to place the value of the variable, since the variable is int then you can only use whole number only. Then, the last part of the Syntax the “;” a semicolon this special characters will always be at a Syntax, because it is the thing that mark some particular segment is complete for the computer to process. There are exception for what I said that semicolon will always be at a Syntax, that is controle structures they uses curly brackets to make the beginning and the end of a segment. Just imagine coding semicolon as a normal period writing, if we don’t put any period the writing will not be structured and will not be easy to read.
When you enter the coding or programming world, you will likely see syntax as one of the biggest battle to master. But, as you see more and more code and introduced to more and more syntax you will get yourself finally comfortable, but this will not be a short journey it will take a step at a time. Well there is a great great good new for the people that see sytax tough, and for so a goe companies (group of enthusiasts, a.k.a nerd or noob (no offense i’m a noob too but slightly improved)). There is hope for us, now companies have made a tools to do sytax thing in coding, those tools are called IDEs or, Integrated Development Environments, which you can download onto your computer most are free like the Java Eclipse and Netbeans I mention in the last post, you can use it to create programs. These IDEs have built in syntax checkers (much like the grammar checker in MS Word) that will let you know if your syntax is incorrect or correct, and will even give you hints with what it thinks you meant to put!.
- Syntax is a structured combination of word or symbols
- Variable example are Syntax example
- Semicolon ended a segment except control structure
Give comment, help you and me grow our knowledge together. Tips, Help and Knowledge would really be appreciated. Thank you, see you on another Article.