www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - True Properties Poll

reply Jesse Phillips <jessekphillips+d gmail.com> writes:
It seem no one is confident in their poll writing skills, so I'll take stab at
it.

This poll is related to D not providing "true" properties. Details and
discussion can be found in DIP4:
http://prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP4

Below you will find a list of options. Please place a maximum of three votes
starting with what you would prefer and then your alternatives. Reasoning can
come after your vote.

    1. Provide a special syntax/keyword to specify properties.
    2. Keep things as they are.
    3. Keep things as they are, resolving the += ... without involving new
property syntax.
    4. Remove current "property" syntax.
    5. Prevent . on rvalues

Extended Voting

    A. #4 should happen with or without a new property syntax.
    B. Preventing . on rvalues should be done anyway.

If I missed something, to bad, write your own poll. Please only respond if you
are voting or commenting on another's vote. This allows top level posts to
contain poll answers only.
Jul 31 2009
next sibling parent reply "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Fri, 31 Jul 2009 15:11:41 -0400, Jesse Phillips  
<jessekphillips+d gmail.com> wrote:

 It seem no one is confident in their poll writing skills, so I'll take  
 stab at it.

 This poll is related to D not providing "true" properties. Details and  
 discussion can be found in DIP4:  
 http://prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP4

 Below you will find a list of options. Please place a maximum of three  
 votes starting with what you would prefer and then your alternatives.  
 Reasoning can come after your vote.

     1. Provide a special syntax/keyword to specify properties.
     2. Keep things as they are.
     3. Keep things as they are, resolving the += ... without involving  
 new property syntax.
     4. Remove current "property" syntax.
     5. Prevent . on rvalues
1 depending on what the proposed "special syntax/keyword" is.
Jul 31 2009
parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Steven Schveighoffer wrote:
 On Fri, 31 Jul 2009 15:11:41 -0400, Jesse Phillips 
 <jessekphillips+d gmail.com> wrote:
 
 It seem no one is confident in their poll writing skills, so I'll take 
 stab at it.

 This poll is related to D not providing "true" properties. Details and 
 discussion can be found in DIP4: 
 http://prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP4

 Below you will find a list of options. Please place a maximum of three 
 votes starting with what you would prefer and then your alternatives. 
 Reasoning can come after your vote.

     1. Provide a special syntax/keyword to specify properties.
     2. Keep things as they are.
     3. Keep things as they are, resolving the += ... without involving 
 new property syntax.
     4. Remove current "property" syntax.
     5. Prevent . on rvalues
1 depending on what the proposed "special syntax/keyword" is.
You already broke the rule :o). I'd say polls should be somewhere online and discussions here. Andrei
Jul 31 2009
prev sibling next sibling parent "Adam D. Ruppe" <destructionator gmail.com> writes:
On Fri, Jul 31, 2009 at 03:11:41PM -0400, Jesse Phillips wrote:
     2. Keep things as they are.
     3. Keep things as they are, resolving the += ... without involving new
property syntax.
Resolving the += would be nice, but isn't a big deal if it is hard to fix. -- Adam D. Ruppe http://arsdnet.net
Jul 31 2009
prev sibling next sibling parent reply Jesse Phillips <jessekphillips+d gmail.com> writes:
Jesse Phillips Wrote:

 It seem no one is confident in their poll writing skills, so I'll take stab at
it.
 
 This poll is related to D not providing "true" properties. Details and
discussion can be found in DIP4:
http://prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP4
 
 Below you will find a list of options. Please place a maximum of three votes
starting with what you would prefer and then your alternatives. Reasoning can
come after your vote.
 
     1. Provide a special syntax/keyword to specify properties.
     2. Keep things as they are.
     3. Keep things as they are, resolving the += ... without involving new
property syntax.
     4. Remove current "property" syntax.
     5. Prevent . on rvalues
 
 Extended Voting
 
     A. #4 should happen with or without a new property syntax.
     B. Preventing . on rvalues should be done anyway.
 
 If I missed something, to bad, write your own poll. Please only respond if you
are voting or commenting on another's vote. This allows top level posts to
contain poll answers only.
3 1 2 Properties are syntactic sugar, I do not find the issues related to function/property ambiguity to an issue. The only thing I have against the current syntax is that you can't use shortcuts like += or ++. If this can be resolved without a new syntax, the better. I find writing property int foo { get; set;} More work than public int foo;
Jul 31 2009
parent "Nick Sabalausky" <a a.a> writes:
"Jesse Phillips" <jessekphillips+d gmail.com> wrote in message 
news:h4vg5q$13mn$1 digitalmars.com...
 I find writing

 property int foo { get; set;}

 More work than

 public int foo;
That's an unfair apples-to-oranges comparison. This: property int foo { get; set;} Is comparable to this current code: private int _foo; int foo() { return _foo; } int foo(int value) { _foo = value; return value; } It is *not* comparable to: public int foo;
Jul 31 2009
prev sibling next sibling parent reply Jesse Phillips <jessekphillips+d gmail.com> writes:
Steven Schveighoffer Wrote:

 On Fri, 31 Jul 2009 15:11:41 -0400, Jesse Phillips  
 <jessekphillips+d gmail.com> wrote:
 
 It seem no one is confident in their poll writing skills, so I'll take  
 stab at it.

 This poll is related to D not providing "true" properties. Details and  
 discussion can be found in DIP4:  
 http://prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP4

 Below you will find a list of options. Please place a maximum of three  
 votes starting with what you would prefer and then your alternatives.  
 Reasoning can come after your vote.

     1. Provide a special syntax/keyword to specify properties.
     2. Keep things as they are.
     3. Keep things as they are, resolving the += ... without involving  
 new property syntax.
     4. Remove current "property" syntax.
     5. Prevent . on rvalues
1 depending on what the proposed "special syntax/keyword" is.
We can work out the needed syntax after we decide that is what will happen.
Jul 31 2009
parent reply "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Fri, 31 Jul 2009 15:41:34 -0400, Jesse Phillips  
<jessekphillips+d gmail.com> wrote:

 Steven Schveighoffer Wrote:

 On Fri, 31 Jul 2009 15:11:41 -0400, Jesse Phillips
 <jessekphillips+d gmail.com> wrote:

 It seem no one is confident in their poll writing skills, so I'll take
 stab at it.

 This poll is related to D not providing "true" properties. Details and
 discussion can be found in DIP4:
 http://prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP4

 Below you will find a list of options. Please place a maximum of three
 votes starting with what you would prefer and then your alternatives.
 Reasoning can come after your vote.

     1. Provide a special syntax/keyword to specify properties.
     2. Keep things as they are.
     3. Keep things as they are, resolving the += ... without involving
 new property syntax.
     4. Remove current "property" syntax.
     5. Prevent . on rvalues
1 depending on what the proposed "special syntax/keyword" is.
We can work out the needed syntax after we decide that is what will happen.
The syntax is an important part. For example, you cited that as the main reason why you wouldn't want property syntax:
 I find writing
  property int foo { get; set;}
  More work than
  public int foo;
And I assume you meant public int foo() and public int foo(int value), since public int foo is a field. But what about changing: public int foo(); public int foo(int value); to property: public int foo(); public int foo(int value); ??? -STeve
Jul 31 2009
parent Jesse Phillips <jessekphillips gmail.com> writes:
On Fri, 31 Jul 2009 15:49:55 -0400, Steven Schveighoffer wrote:

 The syntax is an important part.  For example, you cited that as the
 main reason why you wouldn't want property syntax:
 
 I find writing
  property int foo { get; set;}
  More work than
  public int foo;
And I assume you meant public int foo() and public int foo(int value), since public int foo is a field.
You assume incorrectly. Some other post covered that.
 
 But what about changing:
 
 public int foo();
 public int foo(int value);
 
 to
 
 property:
    public int foo();
    public int foo(int value);
 
 ???
 
 -STeve
What I want is for += ... to be resolved, if it has to be done with "properties" then fine, hence how I voted.
Jul 31 2009
prev sibling next sibling parent "Nick Sabalausky" <a a.a> writes:
"Jesse Phillips" <jessekphillips+d gmail.com> wrote in message 
news:h4vfld$12m2$1 digitalmars.com...
 It seem no one is confident in their poll writing skills, so I'll take 
 stab at it.

 This poll is related to D not providing "true" properties. Details and 
 discussion can be found in DIP4: 
 http://prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP4

 Below you will find a list of options. Please place a maximum of three 
 votes starting with what you would prefer and then your alternatives. 
 Reasoning can come after your vote.

    1. Provide a special syntax/keyword to specify properties.
    2. Keep things as they are.
    3. Keep things as they are, resolving the += ... without involving new 
 property syntax.
    4. Remove current "property" syntax.
    5. Prevent . on rvalues

 Extended Voting

    A. #4 should happen with or without a new property syntax.
    B. Preventing . on rvalues should be done anyway.

 If I missed something, to bad, write your own poll. Please only respond if 
 you are voting or commenting on another's vote. This allows top level 
 posts to contain poll answers only.
Ideal: Combine 1, 3, 4 and fix the problem with . on rvalues without doing #5. Secondary: Anything in between "Ideal" and "Minimum That's Acceptable". Minimum That's Acceptable: Combine 3, 4 and 5. Joke: Let's make a poll on how a properties poll should be made ;)
Jul 31 2009
prev sibling next sibling parent reply Jesse Phillips <jessekphillips+d gmail.com> writes:
Nick Sabalausky Wrote:

 "Jesse Phillips" <jessekphillips+d gmail.com> wrote in message 
 news:h4vg5q$13mn$1 digitalmars.com...
 I find writing

 property int foo { get; set;}

 More work than

 public int foo;
That's an unfair apples-to-oranges comparison. This: property int foo { get; set;} Is comparable to this current code: private int _foo; int foo() { return _foo; } int foo(int value) { _foo = value; return value; } It is *not* comparable to: public int foo;
I thought this might come up, but what do you gain from all that extra code? I heard mention of not being able to get the address of the field... but that is a very deliberate thing to do and should not be the purpose of getters/setters.
Jul 31 2009
parent =?UTF-8?B?IkrDqXLDtG1lIE0uIEJlcmdlciI=?= <jeberger free.fr> writes:
Jesse Phillips wrote:
 Nick Sabalausky Wrote:
=20
 "Jesse Phillips" <jessekphillips+d gmail.com> wrote in message=20
 news:h4vg5q$13mn$1 digitalmars.com...
 I find writing

 property int foo { get; set;}

 More work than

 public int foo;
That's an unfair apples-to-oranges comparison. This: property int foo { get; set;} Is comparable to this current code: private int _foo; int foo() { return _foo; } int foo(int value) { _foo =3D value; return value; } It is *not* comparable to: public int foo;
=20 I thought this might come up, but what do you gain from all that extra =
code? I heard mention of not being able to get the address of the field..= =2E but that is a very deliberate thing to do and should not be the purpo= se of getters/setters. Nothing. If you're property is destined to be read from and written=20 to and all it does is access the underlying field, then you might as=20 well use a public field anyway. A "special" property syntax becomes=20 necessary when you want to do one of the following: - Read only access (note that this can't be done with "const" if=20 you want the object to be able to modify its own properties but want=20 to prevent outside code from doing it); - Write only access; - Take extra action on access (i.e mark object "dirty" or notify=20 registered listeners when a property is changed); - "Virtual" properties, i.e properties that don't correspond to=20 any memory storage (or where the storage is merely a cache for a=20 value that's expensive to compute). Jerome --=20 mailto:jeberger free.fr http://jeberger.free.fr Jabber: jeberger jabber.fr
Jul 31 2009
prev sibling next sibling parent Rainer Deyke <rainerd eldwood.com> writes:
Jesse Phillips wrote:
     5. Prevent . on rvalues
Please, "treat rvalues as const". This is safe: int x = f().y; This is not safe: void g(ref int) {} g(f()); -- Rainer Deyke - rainerd eldwood.com
Jul 31 2009
prev sibling next sibling parent reply Jesse Phillips <jessekphillips+d gmail.com> writes:
Nick Sabalausky Wrote:

 "Jesse Phillips" <jessekphillips+d gmail.com> wrote in message 
 news:h4vfld$12m2$1 digitalmars.com...
 It seem no one is confident in their poll writing skills, so I'll take 
 stab at it.

 This poll is related to D not providing "true" properties. Details and 
 discussion can be found in DIP4: 
 http://prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP4

 Below you will find a list of options. Please place a maximum of three 
 votes starting with what you would prefer and then your alternatives. 
 Reasoning can come after your vote.

    1. Provide a special syntax/keyword to specify properties.
    2. Keep things as they are.
    3. Keep things as they are, resolving the += ... without involving new 
 property syntax.
    4. Remove current "property" syntax.
    5. Prevent . on rvalues

 Extended Voting

    A. #4 should happen with or without a new property syntax.
    B. Preventing . on rvalues should be done anyway.

 If I missed something, to bad, write your own poll. Please only respond if 
 you are voting or commenting on another's vote. This allows top level 
 posts to contain poll answers only.
Ideal: Combine 1, 3, 4 and fix the problem with . on rvalues without doing #5. Secondary: Anything in between "Ideal" and "Minimum That's Acceptable". Minimum That's Acceptable: Combine 3, 4 and 5. Joke: Let's make a poll on how a properties poll should be made ;)
I'm really not sure how 1 and 3 could be "combined," it would leave many of the issues people want 1 to fix. I'm really not sure how 3 and 4 could be combined. One says "go away," the other "stay here."
Jul 31 2009
parent reply Ary Borenszweig <ary esperanto.org.ar> writes:
Jesse Phillips wrote:
 Nick Sabalausky Wrote:
 
 "Jesse Phillips" <jessekphillips+d gmail.com> wrote in message 
 news:h4vfld$12m2$1 digitalmars.com...
 It seem no one is confident in their poll writing skills, so I'll take 
 stab at it.

 This poll is related to D not providing "true" properties. Details and 
 discussion can be found in DIP4: 
 http://prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP4

 Below you will find a list of options. Please place a maximum of three 
 votes starting with what you would prefer and then your alternatives. 
 Reasoning can come after your vote.

    1. Provide a special syntax/keyword to specify properties.
    2. Keep things as they are.
    3. Keep things as they are, resolving the += ... without involving new 
 property syntax.
    4. Remove current "property" syntax.
    5. Prevent . on rvalues

 Extended Voting

    A. #4 should happen with or without a new property syntax.
    B. Preventing . on rvalues should be done anyway.

 If I missed something, to bad, write your own poll. Please only respond if 
 you are voting or commenting on another's vote. This allows top level 
 posts to contain poll answers only.
Ideal: Combine 1, 3, 4 and fix the problem with . on rvalues without doing #5. Secondary: Anything in between "Ideal" and "Minimum That's Acceptable". Minimum That's Acceptable: Combine 3, 4 and 5. Joke: Let's make a poll on how a properties poll should be made ;)
I'm really not sure how 1 and 3 could be "combined," it would leave many of the issues people want 1 to fix. I'm really not sure how 3 and 4 could be combined. One says "go away," the other "stay here."
Hi Jesse, Your replies are not being correctly threaded in my Thunderbird, and it makes analyzing the poll difficult. What's going on?
Jul 31 2009
parent reply Jesse Phillips <jessekphillips+d gmail.com> writes:
Ary Borenszweig Wrote:

 Jesse Phillips wrote:
 Nick Sabalausky Wrote:
 
 "Jesse Phillips" <jessekphillips+d gmail.com> wrote in message 
 news:h4vfld$12m2$1 digitalmars.com...
 It seem no one is confident in their poll writing skills, so I'll take 
 stab at it.

 This poll is related to D not providing "true" properties. Details and 
 discussion can be found in DIP4: 
 http://prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP4

 Below you will find a list of options. Please place a maximum of three 
 votes starting with what you would prefer and then your alternatives. 
 Reasoning can come after your vote.

    1. Provide a special syntax/keyword to specify properties.
    2. Keep things as they are.
    3. Keep things as they are, resolving the += ... without involving new 
 property syntax.
    4. Remove current "property" syntax.
    5. Prevent . on rvalues

 Extended Voting

    A. #4 should happen with or without a new property syntax.
    B. Preventing . on rvalues should be done anyway.

 If I missed something, to bad, write your own poll. Please only respond if 
 you are voting or commenting on another's vote. This allows top level 
 posts to contain poll answers only.
Ideal: Combine 1, 3, 4 and fix the problem with . on rvalues without doing #5. Secondary: Anything in between "Ideal" and "Minimum That's Acceptable". Minimum That's Acceptable: Combine 3, 4 and 5. Joke: Let's make a poll on how a properties poll should be made ;)
I'm really not sure how 1 and 3 could be "combined," it would leave many of the issues people want 1 to fix. I'm really not sure how 3 and 4 could be combined. One says "go away," the other "stay here."
Hi Jesse, Your replies are not being correctly threaded in my Thunderbird, and it makes analyzing the poll difficult. What's going on?
Sorry, I have no idea. Using the web interface? If this works I have a hypothesis though. When making multiple replies with the web interface, first leave the group for another, then come back. But only if this is correctly threaded.
Jul 31 2009
parent reply Ary Borenszweig <ary esperanto.org.ar> writes:
Jesse Phillips wrote:
 Ary Borenszweig Wrote:
 
 Jesse Phillips wrote:
 Hi Jesse,

 Your replies are not being correctly threaded in my Thunderbird, and it 
 makes analyzing the poll difficult. What's going on?
Sorry, I have no idea. Using the web interface? If this works I have a hypothesis though. When making multiple replies with the web interface, first leave the group for another, then come back. But only if this is correctly threaded.
Now it was threaded. :)
Jul 31 2009
parent Jesse Phillips <jessekphillips+d gmail.com> writes:
Ary Borenszweig Wrote:

 Jesse Phillips wrote:
 Ary Borenszweig Wrote:
 
 Jesse Phillips wrote:
 Hi Jesse,

 Your replies are not being correctly threaded in my Thunderbird, and it 
 makes analyzing the poll difficult. What's going on?
Sorry, I have no idea. Using the web interface? If this works I have a hypothesis though. When making multiple replies with the web interface, first leave the group for another, then come back. But only if this is correctly threaded.
Now it was threaded. :)
Ok, I'll be adding that to Wiki4D :P http://www.prowiki.org/wiki4d/wiki.cgi?NewsDmD
Jul 31 2009
prev sibling next sibling parent Ary Borenszweig <ary esperanto.org.ar> writes:
Jesse Phillips wrote:
 Below you will find a list of options. Please place a maximum of three votes
starting with what you would prefer and then your alternatives. Reasoning can
come after your vote.
 
     1. Provide a special syntax/keyword to specify properties.
     2. Keep things as they are.
     3. Keep things as they are, resolving the += ... without involving new
property syntax.
     4. Remove current "property" syntax.
     5. Prevent . on rvalues
1 3 5
 Extended Voting
 
     A. #4 should happen with or without a new property syntax.
Attributes should be introduced for properties, and things such as "align(1)" should be changed to attributes.
     B. Preventing . on rvalues should be done anyway.
Yes.
Jul 31 2009
prev sibling next sibling parent "Simen Kjaeraas" <simen.kjaras gmail.com> writes:
Jesse Phillips wrote:

     1. Provide a special syntax/keyword to specify properties.
     2. Keep things as they are.
     3. Keep things as they are, resolving the += ... without involving  
 new property syntax.
     4. Remove current "property" syntax.
     5. Prevent . on rvalues
1 3
     B. Preventing . on rvalues should be done anyway.
As long as it does not interfere with "a = b.c.d;", I'm fine with it. -- Simen
Jul 31 2009
prev sibling next sibling parent Chad J <chadjoan __spam.is.bad__gmail.com> writes:
Jesse Phillips wrote:
 It seem no one is confident in their poll writing skills, so I'll take stab at
it.
 
 This poll is related to D not providing "true" properties. Details and
discussion can be found in DIP4:
http://prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP4
 
 Below you will find a list of options. Please place a maximum of three votes
starting with what you would prefer and then your alternatives. Reasoning can
come after your vote.
 
     1. Provide a special syntax/keyword to specify properties.
     2. Keep things as they are.
     3. Keep things as they are, resolving the += ... without involving new
property syntax.
     4. Remove current "property" syntax.
     5. Prevent . on rvalues
 
 Extended Voting
 
     A. #4 should happen with or without a new property syntax.
     B. Preventing . on rvalues should be done anyway.
 
 If I missed something, to bad, write your own poll. Please only respond if you
are voting or commenting on another's vote. This allows top level posts to
contain poll answers only.
1 5 4 B (Yeah, you should really have the kind robots count these for you.)
Jul 31 2009
prev sibling next sibling parent "Denis Koroskin" <2korden gmail.com> writes:
On Fri, 31 Jul 2009 23:11:41 +0400, Jesse Phillips  
<jessekphillips+d gmail.com> wrote:

 It seem no one is confident in their poll writing skills, so I'll take  
 stab at it.

 This poll is related to D not providing "true" properties. Details and  
 discussion can be found in DIP4:  
 http://prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP4

 Below you will find a list of options. Please place a maximum of three  
 votes starting with what you would prefer and then your alternatives.  
 Reasoning can come after your vote.

     1. Provide a special syntax/keyword to specify properties.
     2. Keep things as they are.
     3. Keep things as they are, resolving the += ... without involving  
 new property syntax.
     4. Remove current "property" syntax.
     5. Prevent . on rvalues
1, 3, 4
 Extended Voting

     A. #4 should happen with or without a new property syntax.
     B. Preventing . on rvalues should be done anyway.

 If I missed something, to bad, write your own poll. Please only respond  
 if you are voting or commenting on another's vote. This allows top level  
 posts to contain poll answers only.
Aug 01 2009
prev sibling parent Leandro Lucarella <llucax gmail.com> writes:
Jesse Phillips, el 31 de julio a las 15:11 me escribiste:
 It seem no one is confident in their poll writing skills, so I'll take stab at
it.
 
 This poll is related to D not providing "true" properties. Details and
discussion can be found in DIP4:
http://prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP4
 
 Below you will find a list of options. Please place a maximum of three votes
starting with what you would prefer and then your alternatives. Reasoning can
come after your vote.
 
     1. Provide a special syntax/keyword to specify properties.
     2. Keep things as they are.
     3. Keep things as they are, resolving the += ... without involving new
property syntax.
     4. Remove current "property" syntax.
     5. Prevent . on rvalues
1 3 5
 Extended Voting
 
     A. #4 should happen with or without a new property syntax.
     B. Preventing . on rvalues should be done anyway.
B -- Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/ ---------------------------------------------------------------------------- GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05) ---------------------------------------------------------------------------- - Que hac├ęs, ratita? - Espero un ratito...
Aug 01 2009