Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 1
    (My f1rst post here. I am not sure whether this question belongs more to Programmers or SO, so feel free to migrate, if it is needed.) Commented Apr 21, 2013 at 21:23
  • 9
    This is definitely a Programmers post. Welcome! :-) Commented Apr 21, 2013 at 21:49
  • 1
    "Why Not" will provide the answer - by having the same answer - "Because someone needed to make a choice, and that is the choice they made" Same as "Why did they choose "{" and "}" and 1000 other choices they made - "Because". Commented Apr 21, 2013 at 22:41
  • 2
    @mattnz The question is about consistency (not "Why we use ; not |?" (or Why do we use 'else' not 'otherwise'?)) which is not case for one language, but a big number of them. An answer that e.g. "it was made in C as a shorthand for while loop (and multiple statements for inc were thought only later), and people didn't want to change it to avoid programmers' irritation" would be perfectly fine. Commented Apr 21, 2013 at 22:48
  • I recall reading - perhaps in in K&R - that the comma operator was originally added to the language in order to make it possible to initialize more than one variable in the init-expression of a for statement. Commented Apr 22, 2013 at 2:19