From: Louis J Scoras Date: 2006-10-07T12:10:33+09:00 Subject: Re: What is the reason for this syntax? On 10/6/06, MonkeeSage wrote: > Coding conventions (like where you place your braces in C) are > completely different from language syntax rules (like where parameters > to functions and blocks must be). You can code however you like *within > the bounds of the language syntax*. Correct. The issue is how the language decides to draw the line between the two. Take whitespace for instance, as has already been brought up in this thread. In some languages whitespace is syntactically meaningful, while in others it is not. If you believe that indentation should be purely a formatting issue then you probably prefer the latter. Also, you bring up brace style in C. It is true that this matter is left up to convention: the compiler doesn't care about whitespace here and you can break a line before a brace if you wish. However, there isn't any technical reason why it couldn't be a syntactic requirement. The C compiler could have easily said int foo(int x) { // body } is correct, while int foo(int x) { // body } is a compile time error. And why not? clearly intended the former, right? =) I'm not entirely sure, but its possible that I might be--at least partially--playing devil's advocate here. I'll admit that I haven't thought about it enough to be certain whether this would bother me or not. That being said, however, I strongly suspect that it would *not*. Do I wish that you could split lines in ruby before an operator rather than after? Yes. Do I care? Not really. As long as it is consistant in all of the code, its fine. All of this leads to the question: If you have to code to a standard anyway--which you should--would you mind if the language enforced said standard? -- Lou.