Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 689903 of Syntax

  • Revision slug: Glossary/Syntax
  • Revision title: Syntax
  • Revision id: 689903
  • Created:
  • Creator: alispivak
  • Is current revision? No
  • Comment

Revision Content

Summary

The written text used to write code, including characters, punctuation, and reserved words.

In Depth

Syntax describes how symbols, variables and characters must be combined (forming {{Glossary("String")}} similar to sentences in human languages) into a structure (programming language). Syntax are the rules of a programming language and specify the combination and sequence of symbols that are required for correctly structured code. Syntax may differ between programming languages (e.g. syntax is different in {{Glossary("HTML")}} and {{Glossary("C++")}}).

Syntax – the form – is contrasted with {{Glossary("semantics")}} – the meaning. Code must have correct syntax in order to {{Glossary("compile")}} correctly. A syntax error is generated when the syntax is incorrect - the error can be as simple as a missing parenthesis or a forgotten semicolon at the end of a statement. Even these small errors will keep the source code from compiling.

 If a framework has "a clean syntax," for example, this usually implies that few characters are needed to write functionality with it, or that the end result is clear to read and attractive.  If a codebase uses "a lot of syntax," then this means that it contains a large number of characters to achieve its functionality.

Know more

Revision Source

<h2 id="Summary">Summary</h2>
<p>The written text used to write code, including characters, punctuation, and reserved words.</p>
<dl>
</dl>
<h2 id="In_Depth">In Depth</h2>
<p>Syntax describes how symbols, variables and characters must be combined (forming {{Glossary("String")}} similar to sentences in human languages) into a structure (programming language). Syntax are the rules of a programming language and specify the combination and sequence of symbols that are required for correctly structured code. Syntax may differ between programming languages (e.g. syntax is different in {{Glossary("HTML")}} and {{Glossary("C++")}}).</p>
<p>Syntax – the form – is contrasted with {{Glossary("semantics")}} – the meaning. Code must have correct syntax in order to {{Glossary("compile")}} correctly. A syntax error is generated when the syntax is incorrect - the error can be as simple as a missing parenthesis or a forgotten semicolon at the end of a statement. Even these small errors will keep the source code from compiling.</p>
<p>&nbsp;If a <strong>framework</strong> has "a clean syntax," for example, this usually implies that few characters are needed to write functionality with it, or that the end result is clear to read and attractive.&nbsp; If a codebase uses "a lot of syntax," then this means that it contains a large number of characters to achieve its functionality.</p>
<h2 id="Know_more">Know more</h2>
<ul>
 <li>Wikipedia entry on <a href="https://en.wikipedia.org/wiki/Syntax_%28programming_languages%29">syntax</a></li>
</ul>
Revert to this revision