View mode: basic / threaded / horizontal-split · Log in · Help
July 28, 2009
Re: properties
Andrei Alexandrescu pisze:
> Steven Schveighoffer wrote:
>> On Tue, 28 Jul 2009 16:08:58 -0400, Andrei Alexandrescu 
>> <SeeWebsiteForEmail@erdani.org> wrote:
>>
>>> Steven Schveighoffer wrote:
>>>> However, when I see:
>>>>  x.empty;
>>>>  I can't tell what is implied here.
>>>
>>> You can. In either C# or D language it could execute arbitrary code 
>>> that you better know what it's supposed to do. D simply doesn't make 
>>> it "bad style" as C# stupidly does.
>>
>> still not getting it, are you...
>>
>> Just forget it, I think this is a lost cause, I keep making the same 
>> points over and over again, and you keep not reading them.
> 
> I do read them and understand them. I mean, it's not rocket surgery. At 
> the end of the day you say "x = a.b;" looks more like sheer access 
> because that's what happens for fields already. Then you say "a.b()" in 
> any context looks more like an action because it's clear that there's a 
> function call involved. But your arguments are not convincing to me, and 
> in turn I explained why. What would you do if you were me?
> 
> Andrei

You should just accept what others want *although* you don't agree...

Steve's arguments are very good and convincing, and unfortunately 
somehow you don't get them. And I don't see your arguments being 
superior at all.

Sorry for thread hijacking, but such discussions make me want not to use 
D any more... I am writing because I still have some hope...

Maybe community should decide in poll who's arguments are better?

BR
Marcin Kuszczak
July 28, 2009
Re: properties
On Tue, 28 Jul 2009 16:21:09 -0400, Andrei Alexandrescu  
<SeeWebsiteForEmail@erdani.org> wrote:

> Steven Schveighoffer wrote:
>> On Tue, 28 Jul 2009 16:08:58 -0400, Andrei Alexandrescu  
>> <SeeWebsiteForEmail@erdani.org> wrote:
>>
>>> Steven Schveighoffer wrote:
>>>> However, when I see:
>>>>  x.empty;
>>>>  I can't tell what is implied here.
>>>
>>> You can. In either C# or D language it could execute arbitrary code  
>>> that you better know what it's supposed to do. D simply doesn't make  
>>> it "bad style" as C# stupidly does.
>>  still not getting it, are you...
>>  Just forget it, I think this is a lost cause, I keep making the same  
>> points over and over again, and you keep not reading them.
>
> I do read them and understand them. I mean, it's not rocket surgery. At  
> the end of the day you say "x = a.b;" looks more like sheer access  
> because that's what happens for fields already.

No, b has no meaning.  It's not an English word.

a.filter() looks like it should filter something.
a.filter looks like it should access a filter.

But in D, a.filter could mean either, which I guess is fine if you want to  
play it that way, but it's far inferior to C#, where a.filter should  
return a filter, and a.filter() should perform a filtering action.  If it  
doesn't, the author wrote his code incorrectly.  It's as simple as that.

> Then you say "a.b()" in any context looks more like an action because  
> it's clear that there's a function call involved.

Again, b means nothing, so I would have no idea in C# or D.

-Steve
July 28, 2009
Re: properties
I C++, I write a lot of functions with names in the form of get_foo,
set_foo, or is_foo.  The get/set/is isn't just clutter, it serves an
important function in describing the semantics of the function.  A
function named 'empty' has different semantics than a function named
'is_empty'.  A function named 'get_color' has different semantics than a
function named 'color'.

To me, 'y = x;' makes a lot of sense as syntax sugar for 'y = get_x();',
but makes no sense as syntax sugar for 'y = x();'.  Writing 'y = get_x;'
instead of 'y = get_x();' is barely an improvement, and nowhere near as
nice as 'y = x;'.

Likewise, 'x = y;' makes sense as syntax sugar for 'set_x(y);', but not
as syntax sugar for 'x(y);'.  I don't want to have to write 'set_x = y;'.

So, yes, properties are just functions.  However, they are /different/
functions from the functions with the same name as the property, with
different semantics.  Its use as a property is logically part of the
name of a function.


-- 
Rainer Deyke - rainerd@eldwood.com
July 28, 2009
Re: properties
aarti_pl wrote:
> Andrei Alexandrescu pisze:
>> Steven Schveighoffer wrote:
>>> On Tue, 28 Jul 2009 16:08:58 -0400, Andrei Alexandrescu 
>>> <SeeWebsiteForEmail@erdani.org> wrote:
>>>
>>>> Steven Schveighoffer wrote:
>>>>> However, when I see:
>>>>>  x.empty;
>>>>>  I can't tell what is implied here.
>>>>
>>>> You can. In either C# or D language it could execute arbitrary code 
>>>> that you better know what it's supposed to do. D simply doesn't make 
>>>> it "bad style" as C# stupidly does.
>>>
>>> still not getting it, are you...
>>>
>>> Just forget it, I think this is a lost cause, I keep making the same 
>>> points over and over again, and you keep not reading them.
>>
>> I do read them and understand them. I mean, it's not rocket surgery. 
>> At the end of the day you say "x = a.b;" looks more like sheer access 
>> because that's what happens for fields already. Then you say "a.b()" 
>> in any context looks more like an action because it's clear that 
>> there's a function call involved. But your arguments are not 
>> convincing to me, and in turn I explained why. What would you do if 
>> you were me?
>>
>> Andrei
> 
> You should just accept what others want *although* you don't agree...
> 
> Steve's arguments are very good and convincing, and unfortunately 
> somehow you don't get them. And I don't see your arguments being 
> superior at all.
> 
> Sorry for thread hijacking, but such discussions make me want not to use 
> D any more... I am writing because I still have some hope...
> 
> Maybe community should decide in poll who's arguments are better?

I'd like to see a poll about this. I think just a few want the ability 
to remove the () from an argument-less function call, and all of us 
others want the opposite.
July 28, 2009
Re: properties
aarti_pl wrote:
> Andrei Alexandrescu pisze:
>> Steven Schveighoffer wrote:
>>> On Tue, 28 Jul 2009 16:08:58 -0400, Andrei Alexandrescu 
>>> <SeeWebsiteForEmail@erdani.org> wrote:
>>>
>>>> Steven Schveighoffer wrote:
>>>>> However, when I see:
>>>>>  x.empty;
>>>>>  I can't tell what is implied here.
>>>>
>>>> You can. In either C# or D language it could execute arbitrary code 
>>>> that you better know what it's supposed to do. D simply doesn't make 
>>>> it "bad style" as C# stupidly does.
>>>
>>> still not getting it, are you...
>>>
>>> Just forget it, I think this is a lost cause, I keep making the same 
>>> points over and over again, and you keep not reading them.
>>
>> I do read them and understand them. I mean, it's not rocket surgery. 
>> At the end of the day you say "x = a.b;" looks more like sheer access 
>> because that's what happens for fields already. Then you say "a.b()" 
>> in any context looks more like an action because it's clear that 
>> there's a function call involved. But your arguments are not 
>> convincing to me, and in turn I explained why. What would you do if 
>> you were me?
>>
>> Andrei
> 
> You should just accept what others want *although* you don't agree...
> 
> Steve's arguments are very good and convincing, and unfortunately 
> somehow you don't get them. And I don't see your arguments being 
> superior at all.

I do get his arguments. Not being convinced does not mean I don't
understand them. You seem to assume that as soon as I understood his
arguments I'd automatically agree, so somehow I don't understand them.

> Sorry for thread hijacking, but such discussions make me want not to use 
> D any more... I am writing because I still have some hope...

D has great features, and probably less warts than most other languages.
I understand how you feel, but I'd also hope that realistically your use
of the language hinges on a little more than this one issue.

> Maybe community should decide in poll who's arguments are better?

That would be helpful.


Andrei
July 28, 2009
Re: properties
Andrei Alexandrescu:
> > Maybe community should decide in poll who's arguments are better?
> 
> That would be helpful.

Designing a language with polls is an obvious idea, but I have not suggested it in the past because it has some drawbacks too (there's a risk of losing the coherence of the language and to use "political" solutions that are mostly good to close the muzzle of the majority of people).

On the other hand it has some advantages too (example: despite you are intelligent, some names and function/templates signatures you have added to Phobos may be not good because you aren't equal to the average person, everyone has some personal quirks. So designing by poll helps remove such quirks).

So this time, as an experiment, we may try to see what happens using a poll :-)
Language design polls must be not anonymous, each vote must have a name beside it.

I think that a poll done in the past may have lead to different outcomes (for example in two recent changes to the "switch", one by you and one by Walter).

Bye,
bearophile
July 28, 2009
Re: properties
bearophile wrote:
> Andrei Alexandrescu:
>>> Maybe community should decide in poll who's arguments are better?
>> That would be helpful.
> 
> Designing a language with polls is an obvious idea, but I have not suggested it in the past because it has some drawbacks too (there's a risk of losing the coherence of the language and to use "political" solutions that are mostly good to close the muzzle of the majority of people).
> 
> On the other hand it has some advantages too (example: despite you are intelligent, some names and function/templates signatures you have added to Phobos may be not good because you aren't equal to the average person, everyone has some personal quirks. So designing by poll helps remove such quirks).
> 
> So this time, as an experiment, we may try to see what happens using a poll :-)
> Language design polls must be not anonymous, each vote must have a name beside it.
> 
> I think that a poll done in the past may have lead to different outcomes (for example in two recent changes to the "switch", one by you and one by Walter).

Great thoughts. One thing that maybe is not clear is that I afford to 
argue in these debates exactly because I don't get to decide. Walter 
never implements something that is not convinced of. It happens often 
that I suggest an improvement that he doesn't approve for one reason or 
another. Last time I suggested that switch should work with all types 
that support comparison (it's just weird that it only works with ints 
and strings), but he refused to consider it at least for the time being.

So, polls would be very useful to gauge what people want. That's very 
solid information.


Andrei
July 28, 2009
Re: properties
On Tue, Jul 28, 2009 at 1:49 PM, Andrei
Alexandrescu<SeeWebsiteForEmail@erdani.org> wrote:
> aarti_pl wrote:
>>> What would you do if you were me?
>>>
>>> Andrei
>>
>> You should just accept what others want *although* you don't agree...
>>
>> Steve's arguments are very good and convincing, and unfortunately somehow
>> you don't get them. And I don't see your arguments being superior at all.
>
> I do get his arguments. Not being convinced does not mean I don't understand
> them. You seem to assume that as soon as I understood his arguments I'd
> automatically agree, so somehow I don't understand them

I think the expectation is more that you would address or respond to
his argument rather than making your own argument again.

Or say something like this:
The fundamental difference in our viewpoints is that you believe that
expressing extra semantic information to people who read the code is
more valuable that saving some typing.  I believe the opposite.

(feel free to rewrite as you wish)  Then it is clear that you have
understood his argument and have some idea how and where the
difference in opinion really comes from.   Simply repeating your
argument makes it look as though you have not read his.

>> Sorry for thread hijacking, but such discussions make me want not to use D
>> any more... I am writing because I still have some hope...
>
> D has great features, and probably less warts than most other languages. I
> understand how you feel, but I'd also hope that realistically your use of
> the language hinges on a little more than this one issue.

I don't think it's this one issue he's talking about.  I think the
issue is an occasionally repeated history of questionable changes in D
made in the face of strong community opposition.  Like
foreach_reverse.  Such choices may be perfectly valid, but if you find
yourself repeatedly not seeing eye-to-eye with the designers of a
language, you have to wonder if you're in the right language
community.

--bb
July 28, 2009
Re: properties
Bill Baxter wrote:
> On Tue, Jul 28, 2009 at 1:49 PM, Andrei
> Alexandrescu<SeeWebsiteForEmail@erdani.org> wrote:
>> aarti_pl wrote:
>>>> What would you do if you were me?
>>>>
>>>> Andrei
>>> You should just accept what others want *although* you don't agree...
>>>
>>> Steve's arguments are very good and convincing, and unfortunately somehow
>>> you don't get them. And I don't see your arguments being superior at all.
>> I do get his arguments. Not being convinced does not mean I don't understand
>> them. You seem to assume that as soon as I understood his arguments I'd
>> automatically agree, so somehow I don't understand them
> 
> I think the expectation is more that you would address or respond to
> his argument rather than making your own argument again.
> 
> Or say something like this:
> The fundamental difference in our viewpoints is that you believe that
> expressing extra semantic information to people who read the code is
> more valuable that saving some typing.  I believe the opposite.
> 
> (feel free to rewrite as you wish)  Then it is clear that you have
> understood his argument and have some idea how and where the
> difference in opinion really comes from.   Simply repeating your
> argument makes it look as though you have not read his.

Well we both repeated our arguments several times :o). And don't forget: 
I don't get to decide. So such a discussion between Steve and me could 
as well be a discussion between any two participants.

I do have accountability for Phobos, and there haven't been huge debates 
about it that I vetoed against, have there?

>>> Sorry for thread hijacking, but such discussions make me want not to use D
>>> any more... I am writing because I still have some hope...
>> D has great features, and probably less warts than most other languages. I
>> understand how you feel, but I'd also hope that realistically your use of
>> the language hinges on a little more than this one issue.
> 
> I don't think it's this one issue he's talking about.  I think the
> issue is an occasionally repeated history of questionable changes in D
> made in the face of strong community opposition.  Like
> foreach_reverse.  Such choices may be perfectly valid, but if you find
> yourself repeatedly not seeing eye-to-eye with the designers of a
> language, you have to wonder if you're in the right language
> community.

I understand. On the other hand, a lot of good things have been done in 
relative silence, which are likely to positively impact code writing 
experience a great deal. They just need some more riping. For example, I 
consider the recently-introduced value range propagation an excellent 
feature and a well-balanced engineering tradeoff. Such a thing *would* 
be the kind of feature that would make me cast an interested eye over a 
language. Finally, a step forward in the always-muddy world of 
fixed-size integer arithmetic. Then probably I'd try value range 
propagation and see the compiler essentially fail for all cases (Walter, 
Walter... I wonder if you had *any* test case for the thing) and then 
give up in frustration.


Andrei
July 28, 2009
Re: properties
On Tue, Jul 28, 2009 at 03:07:34PM -0500, Andrei Alexandrescu wrote:
> To me, 
> the space-wasting and uncomfortable-to-type parens have always been 
> unpleasant noise.

For what it's worth, I agree with this.

-- 
Adam D. Ruppe
http://arsdnet.net
22 23 24 25 26 27 28 29
Top | Discussion index | About this forum | D home