Switch-case made less buggy, now with PATCH!

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Nov 23 11:43:38 PST 2009


Leandro Lucarella wrote:
> retard, el 23 de noviembre a las 17:34 me escribiste:
>> Mon, 23 Nov 2009 14:18:05 -0300, Leandro Lucarella wrote:
>>
>>> Andrei Alexandrescu, el 22 de noviembre a las 17:11 me escribiste:
>>>> Anyway, I think Chad's proposal has not been discussed here before
>>>> being implemented, which makes it more difficult to accept.
>>> I think the exact opposite. It's much easier to accept (or reject)
>>> something that have an actual implementation. You can talk about
>>> something real, not vaporware. I wish all proposals made here were
>>> proposed with a patch.
>>>
>>> Of course that's a lot of work and people usually don't want to make the
>>> effort to write a patch if chances are it will be rejected. But if the
>>> rules are clear ("your patch can be rejected"), I think you should
>>> encourage feature proposal with proof-of-concept patch.
>> The fact that a patch already exists does not make the design decision 
>> any better. If we all started writing crappy, contradicting extensions 
>> and Walter had to accept everything, D would quickly sink. There are only 
>> a handful of active members in this community that have enough experience 
>> and skills to propose any good features at this point of d development 
>> cycle.
> 
> And what I said above doesn't contradict this, on the contrary.
> 
> In other OSS projects, almost the *only* way to ask for a feature is
> providing a patch. Then the feature is discussed (and most of the time
> discarded). Having a patch only improves the decision making process.
> 
> Again, and in case it's hard to understand, I'm not saying the any patch
> should be accepted. Even more, I don't think Chad's patched should be
> accepted, I also think introducing case !: is a bad idea. I'm just saying
> that the patch was mostly turned down because he didn't asked for other
> devs permission to make the patch, not because of the quality of the patch
> (or the feature) itself. That discourages people to make patches, and
> I think that's *really* bad.
> 
> Again, that was only my perception, maybe this was not the intention of
> the people who wrote the messages.

I understand and agree. One issue we're facing right now is that the 
publication of the D source is relatively recent and the number of 
contributors is relatively low. In this context, if we required anyone 
who ever wants to propose a feature to also provide a patch we'd pretty 
much kill the traffic on this group. I look forward to the day when that 
request will become reasonable.

The positive side remains: Chad now knows enough about the 
implementation to accommodate any change to the design.

At any rate, after having discussed this more with Walter, it looks like 
the switch semantics is here to stay. He claims to use fall through 
fairly often (in spite of the mounting evidence to the contrary) and 
finds the notion that you need to wrote "goto case x;" just before "case 
x:" completely stupid. I disagree but I also want to carefully pick my 
fights so I'll leave this matter to others.


Andrei



More information about the Digitalmars-d mailing list