Date: Tue, 15 Jul 2014 16:25:36 -0400 From: John Baldwin <jhb@freebsd.org> To: gahr@freebsd.org Cc: Ed Schouten <ed@80386.nl>, src-committers@freebsd.org, Ian Lepore <ian@freebsd.org>, svn-src-all@freebsd.org, David Chisnall <theraven@freebsd.org>, svn-src-head@freebsd.org Subject: Re: svn commit: r268491 - head/usr.bin/users Message-ID: <201407151625.36537.jhb@freebsd.org> In-Reply-To: <20140715192149.GR1812@ptrcrt.ch> References: <201407101215.s6ACF3v1055260@svn.freebsd.org> <201407111726.14347.jhb@freebsd.org> <20140715192149.GR1812@ptrcrt.ch>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407151625.36537.jhb>