From owner-svn-src-head@FreeBSD.ORG Sun Jul 13 14:27:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 80260601; Sun, 13 Jul 2014 14:27:38 +0000 (UTC) Date: Sun, 13 Jul 2014 14:27:38 +0000 From: Alexey Dokuchaev To: Hans Ottevanger Subject: Re: svn commit: r268566 - head/usr.bin/users Message-ID: <20140713142738.GA25502@FreeBSD.org> References: <201407120747.s6C7lpYE020200@svn.freebsd.org> <20140712195452.N3279@besplex.bde.org> <53C12C1D.8080101@fastmail.net> <20140712132705.GA45964@FreeBSD.org> <53C290BE.8050102@beastielabs.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53C290BE.8050102@beastielabs.net> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, David Chisnall , Bruce Simpson , Bruce Evans , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jul 2014 14:27:38 -0000 On Sun, Jul 13, 2014 at 03:59:26PM +0200, Hans Ottevanger wrote: > On 07/12/14 15:27, Alexey Dokuchaev wrote: > > 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? > > 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. Very good point. C++ is a nice language when you need to approach some complex problem that you won't be able to grok with C if you want to reach the same level of correctness (god bless destructors), maintability, code conciseness, etc. For a project of those magnitudes, resulting code sizes of C vs. C++ implementation would likely be statistically negligible, so no one will even mention them. ;-) > 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. > > 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. I fully agree. Thanks for spelling it out Hans. ./danfe