From owner-svn-src-all@FreeBSD.ORG Fri Jul 11 16:41:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C17BA79; Fri, 11 Jul 2014 16:41:38 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 017172D30; Fri, 11 Jul 2014 16:41:38 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D98BDB978; Fri, 11 Jul 2014 12:41:36 -0400 (EDT) From: John Baldwin To: Ian Lepore Subject: Re: svn commit: r268491 - head/usr.bin/users Date: Fri, 11 Jul 2014 10:03:57 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201407101215.s6ACF3v1055260@svn.freebsd.org> <201407101127.42252.jhb@freebsd.org> <1405025871.51056.3.camel@revolution.hippie.lan> In-Reply-To: <1405025871.51056.3.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201407111003.57785.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 11 Jul 2014 12:41:36 -0400 (EDT) Cc: svn-src-head@freebsd.org, Ed Schouten , svn-src-all@freebsd.org, src-committers@freebsd.org, Pietro Cerutti X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jul 2014 16:41:38 -0000 On Thursday, July 10, 2014 4:57:51 pm Ian Lepore wrote: > On Thu, 2014-07-10 at 11:27 -0400, John Baldwin wrote: > > On Thursday, July 10, 2014 11:04:56 am Ed Schouten wrote: > > > On 10 July 2014 14:15, Pietro Cerutti wrote: > > > > +using namespace std; > > > > > > Out of curiosity, do we have any style guidelines w.r.t. C++? For > > > example, I would personally not use things like "using namespace std". > > > It becomes hard to figure out where symbols come from. > > > > I would also prefer avoiding 'using namespace' when possible, especially for > > a short program. > > > > > > + sort(begin(names), end(names)); > > > > + vector::iterator last(unique(begin(names), end(names))); > > Seriously? We want this completely readable line changed to: > > std::vector::iterator last(std::unique( > std::begin(names), std::end(names))); > > If so we REALLY need to revist the 80-column limitation. > > I think "using namespace std;" is enough of an idiom in C++ that it > should be allowed and even encouraged unless there's a good reason not > to use it. http://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice is a decent start on the multitude of reasons to avoid using it. I also avoid 'import * from foo' in Python for similar reasons. OTOH, most of the C++ code bases I've had to work with do have a global 'using namespace std'. Great fun when someone decides it would be convenient to add 'using namespace boost' to the mix. -- John Baldwin