Linear syntax: Difference between revisions

Content deleted Content added
No edit summary
Added example
Line 2:
 
'''Linear syntax''' is a [[computer programming|computer-programming]] term for an [[Expression (programming)|expression]] that can be parsed from left to right. Linear syntax implies the ability to write code without the use of [[line feed|line-feed]] or [[carriage return|carriage-return]] characters. Although the use of such characters is recommended for code readability, they are optional, as [[compiler]]s do not rely on them to parse and compile the code. [[HTML]], [[C (programming language)|C]], and [[SQL]] code are examples of languages that employ linear syntax; they all rely on commas, semicolons, and parentheses to separate code blocks.
 
== Example ==
Linear example in SQL:
<source lang="sql">
SELECT name FROM users WHERE level > 10 ORDER BY firstname
</source>
 
Non-linear example in SQL:
<source lang="sql">
SELECT name
FROM users
WHERE level > 10
ORDER BY firstname
</source>
 
[[Category:Programming language concepts]]