Content deleted Content added
→Formatting of C examples: Keep example with braces |
|||
Line 125:
:Good practice in C uses braces here, so that a later addition to the then-clause does the right thing. Moreover, the distinction being raised is between punctuated blocks (C) and indented blocks (Python), so braces are needed. I think the code is fine as it aws (with the braces) -- an example using multiple-statement blocks is ''harmless'' but I do not think it is ''necessary.'' —[[User:Fubar Obfusco|FOo]] 19:24, 21 Sep 2004 (UTC)
::Sorry for the removal of the braces in the first place. I made the change facetiously to try to raise the point that it was a poor example since it was valid without the braces. When I first read the comparison of Python code and C code, it did not clearly communicate to me the difference between the two, because I (as a seasoned C programmer) immediately saw that I could remove those braces. Without the knowledge that Python is indentation based, I (as having no prior knowledge of Python) was momentarily confused since it would be natural to assume (to a C programmer) that perhaps it didn't require braces since it only consisted of one statement. Of course, having read the rest of the text, I realised the point that was being attempted to be made, but isn't the intention of the example to make it obvious? I think that, although the page is about Python, since the comparison is with C, the example should be clear to C programmers what the intented point was. — The anon that made the change 11:23, 22 Sep 2004 (UTC)
|