svn commit: r268491 - head/usr.bin/users

John Baldwin jhb at freebsd.org
Tue Jul 15 20:26:28 UTC 2014


On Tuesday, July 15, 2014 3:21:49 pm Pietro Cerutti wrote:
> On 2014-Jul-10, 11:27, John Baldwin wrote:
> > I would also prefer avoiding 'using namespace' when possible, especially
> > for a short program.
> 
> On 2014-Jul-11, 17:26, John Baldwin wrote:
> > I suppose it would be fine to permit it in small utilities and only in .cc
> > files but not otherwise?
> 
> I'm confused.

One is earlier in the thread and the second is later in the thread after
considering more input.

> There's an answer to that SO article that starts with:
> 
> "Experienced programmers use whatever solves their problems and avoid
> whatever creates new problems."
> 
> And I really think that this is the bottom line. Like any feature,
> "using" declarations can be good or bad, depending how one uses them.

Different people will read that quite differently though.  I can easily see
people using that same statement to argue for all sorts of rules about
"using namespace std" (always, never, sometimes)

> Bottom line: I'd agree to a rule to avoid using directive and
> declarations in header files, but please don't stigmatize "using" as an
> intrinsically bad thing.

I think everyone agrees on not using it in headers, and with David's suggested 
guidelines it seems it would be fine to use in implementation files for nearly 
every C++ program in FreeBSD's base system (we're not going to use boost in 
base utilities).

-- 
John Baldwin


More information about the svn-src-all mailing list