220 6027 <1377884786.3009.51.camel@sara> article
Path: news.gmane.org!not-for-mail
From: Magnus Fromreide <magfr@lysator.liu.se>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Re: Properties Syntax
Date: Fri, 30 Aug 2013 19:46:26 +0200
Lines: 46
Approved: news@gmane.org
Message-ID: <1377884786.3009.51.camel@sara>
References: <ea-mime-5220c4ca-3ea4-716b9646@webmail.numericable.fr>
	 <1377881224.3009.39.camel@sara>
	 <0a76765c-ad46-4013-877e-6f98cd319426@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: ger.gmane.org 1377884787 1769 80.91.229.3 (30 Aug 2013 17:46:27 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 30 Aug 2013 17:46:27 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDELLREETMBRB5FUQOIQKGQEQY3DYUI@isocpp.org Fri Aug 30 19:46:29 2013
Return-path: <std-proposals+bncBDELLREETMBRB5FUQOIQKGQEQY3DYUI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lb0-f200.google.com ([209.85.217.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDELLREETMBRB5FUQOIQKGQEQY3DYUI@isocpp.org>)
	id 1VFSmD-0000T0-Pw
	for gclcip-std-proposals@m.gmane.org; Fri, 30 Aug 2013 19:46:29 +0200
Original-Received: by mail-lb0-f200.google.com with SMTP id y6sf2517537lbh.3
        for <gclcip-std-proposals@m.gmane.org>; Fri, 30 Aug 2013 10:46:29 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=message-id:subject:from:to:date:in-reply-to:references:mime-version
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=JAKjT7xlw32Y8X6qP5C/0oKLva0fXVj96oqxXS3VH+I=;
        b=HbvavXUC/N86/8U0yTGlxq0m0Ru8IjrBuYMXGEMzvveTRsOGDM4mCdHE2AlctaDCba
         Zdq0qnFsHxiaS+M/KfzuNs5BXdPXAqoSAsUsixmTPNRN5yg5MlP12a8YM3YoNgSJ6PfB
         Aqiq/PL3T38CU6qoXeuRH59K2tZrrarcIKl1YdURdrDZhSo4qaYMosglw348g6vQySX2
         reij2GtiPcIm33Pknmw3Y3DZZkMCHEDilpjqfD8yRVaKz8QqDpzlmB7BH2K8yxcnwtZW
         3JSHZg5hyLXomVmPJf6WIcRUvWeul/qN58g9jsgm/mlUsazYFJyJ3QzDQWzGCQbpeUcl
         SGlQ==
X-Received: by 10.152.30.33 with SMTP id p1mr2680559lah.8.1377884788620;
        Fri, 30 Aug 2013 10:46:28 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.121.36 with SMTP id lh4ls455133lab.89.gmail; Fri, 30 Aug
 2013 10:46:27 -0700 (PDT)
X-Received: by 10.112.149.197 with SMTP id uc5mr8697173lbb.19.1377884787704;
        Fri, 30 Aug 2013 10:46:27 -0700 (PDT)
Original-Received: from mail.lysator.liu.se (mail.lysator.liu.se. [2001:6b0:17:f0a0::3])
        by mx.google.com with ESMTPS id ao5si4965824lac.144.1969.12.31.16.00.00
        (version=TLSv1 cipher=RC4-SHA bits=128/128);
        Fri, 30 Aug 2013 10:46:27 -0700 (PDT)
Received-SPF: pass (google.com: domain of magfr@lysator.liu.se designates 2001:6b0:17:f0a0::3 as permitted sender) client-ip=2001:6b0:17:f0a0::3;
Original-Received: from mail.lysator.liu.se (localhost [127.0.0.1])
	by mail.lysator.liu.se (Postfix) with ESMTP id 2711540012
	for <std-proposals@isocpp.org>; Fri, 30 Aug 2013 19:46:27 +0200 (CEST)
Original-Received: from [192.168.0.101] (h-176-10-249-241.na.cust.bahnhof.se [176.10.249.241])
	(using SSLv3 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.lysator.liu.se (Postfix) with ESMTPSA id 079D640011
	for <std-proposals@isocpp.org>; Fri, 30 Aug 2013 19:46:27 +0200 (CEST)
In-Reply-To: <0a76765c-ad46-4013-877e-6f98cd319426@isocpp.org>
X-Mailer: Evolution 3.4.4-4+b1
X-Virus-Scanned: ClamAV using ClamSMTP
X-Original-Sender: magfr@lysator.liu.se
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of magfr@lysator.liu.se designates 2001:6b0:17:f0a0::3 as permitted
 sender) smtp.mail=magfr@lysator.liu.se
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:6027
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/6027>

On Fri, 2013-08-30 at 10:01 -0700, Bengt Gustafsson wrote:
> Magnus:
> 
> 
> You are of course right that from a clearness standpoint a function
> call should look like one and a member access look like that.
> 
> 
> So the question is whether this is more important than being able to
> migrate from variable to method without breaking existing usages.
> 
I think that is one of the big questions here.

> I know that many think that global data members are a no-no, but isn't
> that a consequence of considering the possibility that checking of the
> value or action on its change may be needed in the future, and thus
> actually the only solution to the migration problem being promoted to
> a self-sufficient rule. Apart from the scare of future code breaking
> changes, why would setting a member by calling setters be better than
> setting it directly? At least this is the usual motivation for
> setters/getters I have seen in text books.
> 
I do not think setters/getters are a good thing either, just that they
are better than public members but I admit that the reason they are
better is as outlined above.

The reason they are bad is that they expose internal parts of the
object, just like public members do.

I prefer if the code is at a higher level so I have a Square with two
constructors, one taking a distance and the other taking an area. When I
want to change my Square instance using either property i construct a
new Square and assign it to the original one.

Yes - sometimes this won't work but that is a problem for those times.

/MF

-- 

--- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.
