Syntax - MDN Web Docs Glossary: Definitions of Web-related terms 编辑

Syntax specifies the required combination and sequence of characters making up correctly structured code. Syntax generally includes grammar and the rules that apply to writing it, such as indentation requirements in Python.

Syntax varies from language to language (e.g., syntax is different in HTML and JavaScript). Although languages can share few similarities in terms of their syntaxes for example "operand operator operand" rule in javaScript and python. This does not mean the two langauges share similarities with syntax.

Syntax applies both to programming languages (commands to the computer) and markup languages (document structure information) alike.

Syntax only governs ordering and structure; the instructions must also be meaningful, which is the province of semantics.

Code must have correct syntax in order to compile correctly, otherwise a syntax error occurs. Even small errors, like a missing parenthesis, can stop source code from compiling successfully.

Frameworks are said to have a "clean" syntax if they produce simple, readable, concise results. If a codebase uses "a lot of syntax", it requires more characters to achieve the same functionality.

Learn more

General knowledge

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:144 次

字数:1945

最后编辑:8年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文