Talk:Syntax (computer science): Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>Subpagination Bot
m (Add {{subpages}} and remove checklist (details))
imported>Ed Poor
(An amateur groping for an answer here)
Line 1: Line 1:
{{subpages}}
{{subpages}}
This is way too abstruse and formal. I think of syntax as the "grammar" of computer programming. Like, how do you write a [[loop]]?
[[Java]] example:
(for int i = 0; i < 10; i++) {
    System.out.println(i);
}
That will print the first ten natural numbers (0 to 9) on the user's console. The syntax to do the same thing is very similar in C or PHP. It has been said that the [[curly brace family]] of programming languages share a common syntax.
[[BASIC]] uses a different syntax to express the same idea (or do the same thing).
For i = 0 to 9
    Debug.Print i
Next i
Or am I just mixed up about what the word ''syntax'' means? --[[User:Ed Poor|Ed Poor]] 17:04, 24 January 2009 (UTC)

Revision as of 11:04, 24 January 2009

This article is basically copied from an external source and has not been approved.
Main Article
Discussion
Related Articles  [?]
Bibliography  [?]
External Links  [?]
Citable Version  [?]
 
To learn how to update the categories for this article, see here. To update categories, edit the metadata template.
 Definition The set of allowed reserved words and possible token order in a program. [d] [e]
Checklist and Archives
 Workgroup category Computers [Categories OK]
 Talk Archive none  English language variant British English

This is way too abstruse and formal. I think of syntax as the "grammar" of computer programming. Like, how do you write a loop?

Java example:

(for int i = 0; i < 10; i++) {
   System.out.println(i);
}

That will print the first ten natural numbers (0 to 9) on the user's console. The syntax to do the same thing is very similar in C or PHP. It has been said that the curly brace family of programming languages share a common syntax.

BASIC uses a different syntax to express the same idea (or do the same thing).

For i = 0 to 9
   Debug.Print i

Next i

Or am I just mixed up about what the word syntax means? --Ed Poor 17:04, 24 January 2009 (UTC)