Re: Named parameters?
"cody" <deutronium@gmx .de> wrote in message
news:uRCJA0hWFH A.3712@TK2MSFTN GP09.phx.gbl...[color=blue][color=green][color=darkred]
>>>> It adds support for a (IMHO) better design pattern than optional
>>>> parameters, thoughts anyone?
>>>
>>>
>>> Anders Hejlsberg spoke in a panel about a new syntax proposal for
>>> creating objects (not just for parameter passing). It was something like
>>> that:[/color]
>>
>> What panel was that?[/color]
>
> I found it on msdn TV, just look into the archives of microsoft.com after
> "csharp features - AndersHejlsberg _300.wmv".
>[color=green][color=darkred]
>>> But then you cannot do something like that:
>>>
>>> Point p = new Point{X=10, Y=X}
>>>
>>> because you cannot access X from there. In that case you have to use my
>>> proposed character which distinguishes between a property of that object
>>> and a local variable.
>>>[/color]
>>
>> Which is a wholely bad idea, IMHO. You wouldn't do new Point(10, X)
>> either. I don't really see how this relates to named parameters either.[/color]
>
> It would make it easier/less verbose to create parameter objects.
>[color=green]
>> I really think adding a character to distinguish between properties and
>> variables is one step into turning the langauge into a mess not worth
>> working with.[/color]
>
> Maybe you're right. A character for distinguishing was just a suggestion,
> maybe not a good one.
>[/color]
Sorry for getting back so late, either my newsreader or the MS servers just
decided to give me about 200 entries I missed.
I do not like distingishing characters(even for the set thing we talked
about a while back, I still havn't figured out a way to keep things
consistent AND allow string and other IENumerables to be atomic units
without a distingusihing character or operator). Expanded object
construction that allows for blocks of property setters wouldn't be bad,
though.
"cody" <deutronium@gmx .de> wrote in message
news:uRCJA0hWFH A.3712@TK2MSFTN GP09.phx.gbl...[color=blue][color=green][color=darkred]
>>>> It adds support for a (IMHO) better design pattern than optional
>>>> parameters, thoughts anyone?
>>>
>>>
>>> Anders Hejlsberg spoke in a panel about a new syntax proposal for
>>> creating objects (not just for parameter passing). It was something like
>>> that:[/color]
>>
>> What panel was that?[/color]
>
> I found it on msdn TV, just look into the archives of microsoft.com after
> "csharp features - AndersHejlsberg _300.wmv".
>[color=green][color=darkred]
>>> But then you cannot do something like that:
>>>
>>> Point p = new Point{X=10, Y=X}
>>>
>>> because you cannot access X from there. In that case you have to use my
>>> proposed character which distinguishes between a property of that object
>>> and a local variable.
>>>[/color]
>>
>> Which is a wholely bad idea, IMHO. You wouldn't do new Point(10, X)
>> either. I don't really see how this relates to named parameters either.[/color]
>
> It would make it easier/less verbose to create parameter objects.
>[color=green]
>> I really think adding a character to distinguish between properties and
>> variables is one step into turning the langauge into a mess not worth
>> working with.[/color]
>
> Maybe you're right. A character for distinguishing was just a suggestion,
> maybe not a good one.
>[/color]
Sorry for getting back so late, either my newsreader or the MS servers just
decided to give me about 200 entries I missed.
I do not like distingishing characters(even for the set thing we talked
about a while back, I still havn't figured out a way to keep things
consistent AND allow string and other IENumerables to be atomic units
without a distingusihing character or operator). Expanded object
construction that allows for blocks of property setters wouldn't be bad,
though.
Comment