From owner-svn-src-all@FreeBSD.ORG Thu Jul 10 16:38:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E613165B; Thu, 10 Jul 2014 16:38:24 +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 BD5862C7F; Thu, 10 Jul 2014 16:38:24 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 444F9B917; Thu, 10 Jul 2014 12:38:22 -0400 (EDT) From: John Baldwin To: Ed Schouten Subject: Re: svn commit: r268491 - head/usr.bin/users Date: Thu, 10 Jul 2014 11:27:42 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <201407101215.s6ACF3v1055260@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201407101127.42252.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 10 Jul 2014 12:38:22 -0400 (EDT) Cc: svn-src-head@freebsd.org, 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: Thu, 10 Jul 2014 16:38:25 -0000 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))); > > This could also just be a std::set, right? > > Even though I actually think C++ is a lot nicer than C, do we really > think it is actually worth proactively replacing already existent > tools? This specific tool has now become three times as big as the > previous version (7128 -> 23840 bytes). It'd be even shorter code (and a larger runtime footprint) to write it in python. :) -- John Baldwin