Date: Sun, 13 Jul 2014 15:59:26 +0200 From: Hans Ottevanger <hans@beastielabs.net> To: Alexey Dokuchaev <danfe@FreeBSD.org>, Bruce Simpson <bms@fastmail.net> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David Chisnall <theraven@freebsd.org>, Bruce Evans <brde@optusnet.com.au> Subject: Re: svn commit: r268566 - head/usr.bin/users Message-ID: <53C290BE.8050102@beastielabs.net> In-Reply-To: <20140712132705.GA45964@FreeBSD.org> References: <201407120747.s6C7lpYE020200@svn.freebsd.org> <20140712195452.N3279@besplex.bde.org> <53C12C1D.8080101@fastmail.net> <20140712132705.GA45964@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 07/12/14 15:27, Alexey Dokuchaev wrote: > On Sat, Jul 12, 2014 at 01:37:49PM +0100, Bruce Simpson wrote: >> On 12/07/2014 12:34, Bruce Evans wrote: >>> This joke is bad. The C++ version is worse in every way. >> >> I concur with everything you have said in your message. Moral of story: it >> is very, very easy to introduce bloat using C++, and using a higher level >> language does not automatically lead to better code quality. > > +1. Now the question is, how do we come out of this mess? Shall we redo > it in C again? Polish C++ version? Merge it with w(1) as suggested? > Concerning the commit itself, I don't have much to add to the comments by Bruce Evans. More in general, in my experience C++ is not that suitable as a language for this kind of small utilities, where you do not need its abstraction facilities. This could be the reason why the original C version was as good as and (if polished a bit) even better (clearer) than the C++ version. Additionally, one of the properties of a code tree that influences quality is uniformity. Rewriting random small C utilities that work perfectly well in C++ breaks uniformity. Before being accused of hating C++, I like to mention that I have been involved for quite a few years in several HPC projects that use C++, but there you actually need the abstraction facilities. I can imagine that some selected utilities (or groups of utilities that share abstractions) that are difficult to maintain when written in C are rewritten in C++, but some discussion in current@ or hackers@ beforehand might be in order. Regards, Hans
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53C290BE.8050102>