220 41022 <20181115085939.GO2073@edge.cmeerw.net> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Christof Meerwald <cmeerw@cmeerw.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: down with namespace braces
Date: Thu, 15 Nov 2018 09:59:39 +0100
Lines: 71
Approved: news@gmane.org
Message-ID: <20181115085939.GO2073@edge.cmeerw.net>
References: <e3afb61b-bdbf-45a8-b914-d555848baade@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: blaine.gmane.org 1542272252 26317 195.159.176.226 (15 Nov 2018 08:57:32 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Thu, 15 Nov 2018 08:57:32 +0000 (UTC)
User-Agent: Mutt/1.9.4 (2018-02-28)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCHK3YEERMCBB6XKWTPQKGQEK3EEHIQ@isocpp.org Thu Nov 15 09:57:28 2018
Return-path: <std-proposals+bncBCHK3YEERMCBB6XKWTPQKGQEK3EEHIQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wr1-f70.google.com ([209.85.221.70])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCHK3YEERMCBB6XKWTPQKGQEK3EEHIQ@isocpp.org>)
	id 1gNDSq-0006kN-P4
	for gclcip-std-proposals@m.gmane.org; Thu, 15 Nov 2018 09:57:28 +0100
Original-Received: by mail-wr1-f70.google.com with SMTP id o9-v6sf20483612wrw.2
        for <gclcip-std-proposals@m.gmane.org>; Thu, 15 Nov 2018 00:59:39 -0800 (PST)
ARC-Seal: i=2; a=rsa-sha256; t=1542272379; cv=pass;
        d=google.com; s=arc-20160816;
        b=MTO4JDRi43m0jGLg2ve4LRkTywmTc1ywYF9wys64z88oolT02/mH58+RA6o7HvZ4gr
         awD4iOY8K3BXKT9jkm9EQReZCnoQXFW2Z9pqpkMoTsAgGLHJGoQleRajJvwmEzR0Aaj1
         T4FkDJwe/XFzdDuBZWNBXipQ7KFA8SCqvBxPOY/YTg6yl5g9P9HQzrcZ0Q+Jtk9GOG7t
         m2GpzFrENukFtzCjWuSU5gDFvtH60jvhKbhfWLXTtVjqh/qQ3/niKpzvnBFRf6cTDVMo
         FkJ67jAyzJw3YH+JfUbMiklANjRxiMRi1Zml8qhyt1hopVCWT8tgg1cxw2Ra89+3d1wh
         4j8w==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:user-agent:in-reply-to
         :content-disposition:mime-version:references:message-id:subject:to
         :from:date:dkim-signature;
        bh=euUkq8J+LMot5qiIz0epE43TpbBZg1gyrKRz2nzAN8g=;
        b=XzjK11sI60AoKO6C9/4BTcF/+GKcSqzv9zi5gtfGfjttvw2k8qACgITTGT4kgA6IKa
         F3mo0C2gHK/RYFqCbd8za3obGKUdFYLVH6tHMr98224nSKvIaCVTLeydigQ66XBwkOIu
         BEweoZhQ4ZgR8JxwxhGHzmx8RGcb5jl6PCywFgiLnckMW2pAW4ivZuj9l8CFnY6oxdZ7
         N2D1uj0GypIID44l30ZRKFwjYw9iiLfCfSIp0eg319AgCUDTYvfJDV6+LvSqV7w9puHI
         o5J3b8ntNBdFPevZhVy7987ZcY3jVlou/G/GnH0LwF+UXKmKoq2w2b0p4IMha/I86RXm
         4Ipw==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@cmeerw.org header.s=dkim header.b=Sn59NnhH;
       spf=neutral (google.com: 2a0a:51c0::ffa is neither permitted nor denied by best guess record for domain of cmeerw@cmeerw.org) smtp.mailfrom=cmeerw@cmeerw.org
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:subject:message-id:references:mime-version
         :content-disposition:in-reply-to:user-agent:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=euUkq8J+LMot5qiIz0epE43TpbBZg1gyrKRz2nzAN8g=;
        b=xSaWfsbT3lm4xvcuAn/kiZhAHd8d8fGPB4KiC1Zkp5fLbM4MOzcJCTzMQWQwg+k4md
         UuXRKJTIY12eG3D9VS7i/k8fofGZ4XyUMPeJm2/S5uwK2Oclycb/4YRslj8WMxtKLuOB
         NLFkK2Ju0G2P9ojLlu3GCrSQAFhaeCz9sMIbhIYKPsjA8TSnBOQh5f0zGzVS/5aP3rNU
         VjwVYJYmO/xRqfTNzq6FsAO8eDBl80quUeYXhuWlh77Q3zY0ZkkTBMK3JOPct383/3Xv
         uq+Uz8C56gnfkIIJC+EA3tOTtAn3HpZQlFN0rI64z9H88EFkoFGRPpGja+gGHRx9uEZj
         5A9w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:subject:message-id:references
         :mime-version:content-disposition:in-reply-to:user-agent
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post
         :list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=euUkq8J+LMot5qiIz0epE43TpbBZg1gyrKRz2nzAN8g=;
        b=p6BHZVhbrxB4/a2wtCJfK5c6TAYtkw9PFwD5Ki8CUYPTm9RRB/FjGAbM6+FOmpFgA3
         +uBkGUCkwmvNCh72RtSXSjiJAyQJQ5kI6kN6TRHe+ko6iTGpngWAK/W545/f6pUPjDHy
         hC4rzYQKp6JYpWrhZEy3KZln930OgjGf5EvIQfLi6G3z4ZtfhR1mpLi5aLzjYButv9xO
         KuKz3mdr6rWFg+CyqJY2KLfM/wqtq0mK4Yl3tLelnZTqyxdYJhI1bhss5MFuoNYBVjUs
         /fKnVbZyjZEaXOvyaN/gVSpoxehq1Jodp9Jd5fiRCx5pacURuVLJGJx7Cebnw1PVUCCU
        
X-Gm-Message-State: AGRZ1gLg218AG2UoNac0vXnuPCEYWnhVOG0rZ0p72SfYBmcCLCQ3ZOwo
	czvRAqKlX1q344Owup0nI56gOQ==
X-Google-Smtp-Source: AJdET5dDMbm1K2dQQpQdSGlYsV30NKfRy3qgBl39hgsSg5ACiPXs+eajVguI6AxBs+6mGK399ugEng==
X-Received: by 2002:a1c:8b8e:: with SMTP id n136-v6mr1052732wmd.18.1542272379380;
        Thu, 15 Nov 2018 00:59:39 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a1c:9b10:: with SMTP id d16-v6ls770477wme.3.gmail; Thu, 15
 Nov 2018 00:59:38 -0800 (PST)
X-Received: by 2002:a1c:8791:: with SMTP id j139-v6mr4575553wmd.76.1542272378114;
        Thu, 15 Nov 2018 00:59:38 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1542272378; cv=none;
        d=google.com; s=arc-20160816;
        b=qtdfuBs6LXZBoBvY8muiuuIm7eaBuwMobxSTcsrYK4cFGKdetstqfgzRTBr8yAy9jm
         DyUmcatOX/Ld5dN0NCSGhMmX7LYVKF9GDL9ks1FXADVqEpyVATTrdVa0GiqbiS8uyPhb
         /fkFM2dgiIAV4lqNFfU6H0cIpBwH6ImPiQtMfouUooID/BpMm2ABhqiMqE7aPuPQFGzW
         y3Ui7IxqcapwXh7fx6TnT6nBEhBIFoMgFAxisSzcqXbEJsHGEsWtpKP+qOf5d4AsDAjr
         9d6cqpTjueagKcEymR4b3ISUxwrj8SLeGotr0RKWkj9DSwajLfwKQCLftCl1Deo1cWaN
         kM5A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=user-agent:in-reply-to:content-disposition:mime-version:references
         :message-id:subject:to:from:date:dkim-signature;
        bh=w6bNYzLowBY+y4XkzddnU08Nw68ERq0gvqXGh3CK7Os=;
        b=MQnaTpx7o4kT7qNpSavmMaFCBpgaCzAIFuZmZhCXSQ7HDYjxzjolmIJa4j3sPfUyOM
         pXjjQpNoR+HAquJptmlSoRdccCWYV18VMlz4S2mGjEZv8vGVjQ78yTICat4Q5HjHMuAG
         XbRNHqpXVH08Uts2SiEJvFIV1f47MPk+LjgrvlT8QVqsQU42yUPs8YBM/5FpGS1Ajjrd
         yvLseUQ1JMUOgGa3ly73SZFiyUdhKg/uRVQh5JMmc+i9o/271a79Db3YPzrMpfkUa9C8
         fGKYD4yiNYvmTVBgooRJAbXhDbc1pZi07FzKAq1hNX46QIi86kSjoTdz4qXXJehVx/n7
         gK8Q==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@cmeerw.org header.s=dkim header.b=Sn59NnhH;
       spf=neutral (google.com: 2a0a:51c0::ffa is neither permitted nor denied by best guess record for domain of cmeerw@cmeerw.org) smtp.mailfrom=cmeerw@cmeerw.org
Original-Received: from edge.cmeerw.net (edge.cmeerw.net. [2a0a:51c0::ffa])
        by mx.google.com with ESMTPS id c1-v6si20963071wre.292.2018.11.15.00.59.37
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
        Thu, 15 Nov 2018 00:59:37 -0800 (PST)
Received-SPF: neutral (google.com: 2a0a:51c0::ffa is neither permitted nor denied by best guess record for domain of cmeerw@cmeerw.org) client-ip=2a0a:51c0::ffa;
Original-Received: from cmeerw by edge.cmeerw.net with local (Exim 4.91)
	(envelope-from <cmeerw@cmeerw.org>)
	id 1gNDUx-0004r4-8u; Thu, 15 Nov 2018 09:59:39 +0100
Content-Disposition: inline
In-Reply-To: <e3afb61b-bdbf-45a8-b914-d555848baade@isocpp.org>
X-PGP-Key: 1024D/2B10BE68, 1998-06-29
X-PGP-Fingerprint: 0289 5466 C1F5 B03C DBA7  6304 8CAF 9782 2B10 BE68
X-Original-Sender: cmeerw@cmeerw.org
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@cmeerw.org header.s=dkim header.b=Sn59NnhH;       spf=neutral
 (google.com: 2a0a:51c0::ffa is neither permitted nor denied by best guess
 record for domain of cmeerw@cmeerw.org) smtp.mailfrom=cmeerw@cmeerw.org
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:41022
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/41022>

Hi,

On Thu, Nov 15, 2018 at 12:41:06AM -0800, gmisocpp@gmail.com wrote:
> Currently in C++ we defined code in namespaces like this
> 
> namespace my_name_space
> {
> class whatever
> {
> }
> } // my_name_space
> 
> 
> I find this syntax unsatisfying because:
> 1. The general advice in most code style guidelines I've seen is to not 
> intent code in a namespace. This means it puts two braces together at the 
> same indentation level which I find rather ugly.

Really, is that the advice? Don't think I have seen that advice.


> 2.  As namespaces tend to contain many lines of code the closing brace is a 
> long way away from where it is opened which means you are obligated to put 
> a comment in saying what the namespace closing namespace brace refers to. 
> If you don't, it's really hard to know what the brace refers to just by 
> looking at i.

Code editors know how to match braces.

BTW, another option would be:

namespace my_name_space
{
  class whatever;
}

class my_name_space::whatever
{
};


> 3. If you do put a comment you the comment can get out of sync if you 
> change the namespace name.
> 
> I would much rather something like this:
> 
> namespace my_name_space:
> 
> class whatever
> {
> }
> 
> namespace my_name_space;

It seems way too easy to confuse ":" with ";" to make this a viable
option.


Christof

-- 

http://cmeerw.org                              sip:cmeerw at cmeerw.org
mailto:cmeerw at cmeerw.org                   xmpp:cmeerw at cmeerw.org

-- 
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/20181115085939.GO2073%40edge.cmeerw.net.

.
