Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jul 2014 20:38:16 +0100
From:      David Chisnall <theraven@FreeBSD.org>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        Ed Schouten <ed@80386.nl>, src-committers@freebsd.org, Ian Lepore <ian@freebsd.org>, svn-src-all@freebsd.org, Pietro Cerutti <gahr@freebsd.org>, svn-src-head@freebsd.org
Subject:   Re: svn commit: r268491 - head/usr.bin/users
Message-ID:  <12328E44-58A8-4334-A7F4-C7F29C9F6D0E@FreeBSD.org>
In-Reply-To: <201407111003.57785.jhb@freebsd.org>
References:  <201407101215.s6ACF3v1055260@svn.freebsd.org> <201407101127.42252.jhb@freebsd.org> <1405025871.51056.3.camel@revolution.hippie.lan> <201407111003.57785.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 11 Jul 2014, at 15:03, John Baldwin <jhb@FreeBSD.org> wrote:

>=20
> =
http://stackoverflow.com/questions/1452721/why-is-using-namespace-std-cons=
idered-bad-practice
>=20
> is a decent start on the multitude of reasons to avoid using it.
>=20
> I also avoid 'import * from foo' in Python for similar reasons.
>=20
> 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.

Note that, even though 'using namespace std' is a bad idea, 'using =
std::vector; using std::string' and so on is not so bad.=20

For things that live in the base system, there's not much danger of =
boost conflicts.  'using namespace std' is mostly a problem when it's in =
headers (especially library headers), because it can break large amounts =
of code.  In a tiny utility, it's probably the right thing to do. =20

David




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?12328E44-58A8-4334-A7F4-C7F29C9F6D0E>