From owner-svn-src-all@FreeBSD.ORG Sun Jul 13 13:59:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15962C93; Sun, 13 Jul 2014 13:59:34 +0000 (UTC) Received: from mail.beastielabs.net (unknown [IPv6:2001:888:1227:0:200:24ff:fec9:5934]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C14B328AD; Sun, 13 Jul 2014 13:59:32 +0000 (UTC) Received: from beastie.hotsoft.nl (beastie.hotsoft.nl [IPv6:2001:888:1227:0:219:d1ff:fee8:91eb]) by mail.beastielabs.net (8.14.7/8.14.7) with ESMTP id s6DDxQ3n056533; Sun, 13 Jul 2014 15:59:26 +0200 (CEST) (envelope-from hans@beastielabs.net) Message-ID: <53C290BE.8050102@beastielabs.net> Date: Sun, 13 Jul 2014 15:59:26 +0200 From: Hans Ottevanger User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Alexey Dokuchaev , Bruce Simpson Subject: Re: svn commit: r268566 - head/usr.bin/users References: <201407120747.s6C7lpYE020200@svn.freebsd.org> <20140712195452.N3279@besplex.bde.org> <53C12C1D.8080101@fastmail.net> <20140712132705.GA45964@FreeBSD.org> In-Reply-To: <20140712132705.GA45964@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David Chisnall , Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jul 2014 13:59:34 -0000 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