Optional braces

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Aug 26 08:03:21 PDT 2011


On 8/25/11 9:13 PM, Walter Bright wrote:
> On 8/25/2011 6:30 PM, Andrei Alexandrescu wrote:
>> On 8/25/11 6:10 PM, Walter Bright wrote:
>>> On 8/25/2011 6:04 PM, Nick Sabalausky wrote:
>>>> Oh god no, don't ban that. I *like* to do that sort of thing:
>>>
>>> Unusual, but legitimate. I think I'll shelve the idea.
>>
>> It would be great to reconsider. The counter-argument is very weak.
>
> We've already put a number of special cases in the grammar to ward off
> "bugs".
>
> But I worry that we might wind up tarting up the language with too many
> a boatload of them, to the point where it becomes a confusing mass. At
> what point should Meg Ryan stop with the plastic surgery? :-)

It's a legitimate concern, and there's no right response to it. My point 
is that the argument is weak and caving to it would be a mistake. In 
essence Nick claims he can't be bothered to change:

if (long_expression_one)
if (long_expression_two)
if (long_expression_three)
   statement

with

if ((long_expression_one)
&& (long_expression_two)
&& (long_expression_three))
   statement

which adds a grand total of two parens. The claim "blah blah long thing 
with the simple unrelated condition requiring ugly line breaks and 
screwy formattng/alignment in a big pita to read uber-expression. fuck 
this shit. It looks ok in english, but in code the damn thing reads like 
a fucking regex" does not stand scrutiny, and mixing in the matter of 
indentation is a red herring as indentation is unaffected by the 
introduction of the rule.

I'll also note that the argument smacks of the misleading vividness 
fallacy (http://en.wikipedia.org/wiki/Misleading_vividness). We 
shouldn't shelve an idea because a poor argument against it was 
eloquently phrased.

Finally, we've derived significant benefits from ideas in the same 
spirit. I don't see signs that we've started overdoing it, or that the 
returns are diminishing. To me all signs point to a fertile approach to 
explore.


Andrei


More information about the Digitalmars-d mailing list