Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jul 2014 11:27:42 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        Ed Schouten <ed@80386.nl>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pietro Cerutti <gahr@freebsd.org>
Subject:   Re: svn commit: r268491 - head/usr.bin/users
Message-ID:  <201407101127.42252.jhb@freebsd.org>
In-Reply-To: <CAJOYFBCQjjN7ep12zivnmFjfeeP1SeoYa963mQbMJr9DD%2BfUnw@mail.gmail.com>
References:  <201407101215.s6ACF3v1055260@svn.freebsd.org> <CAJOYFBCQjjN7ep12zivnmFjfeeP1SeoYa963mQbMJr9DD%2BfUnw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday, July 10, 2014 11:04:56 am Ed Schouten wrote:
> On 10 July 2014 14:15, Pietro Cerutti <gahr@freebsd.org> 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<string>::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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407101127.42252.jhb>