Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Jul 2014 14:27:38 +0000
From:      Alexey Dokuchaev <danfe@FreeBSD.org>
To:        Hans Ottevanger <hans@beastielabs.net>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, David Chisnall <theraven@freebsd.org>, Bruce Simpson <bms@fastmail.net>, Bruce Evans <brde@optusnet.com.au>, svn-src-head@freebsd.org
Subject:   Re: svn commit: r268566 - head/usr.bin/users
Message-ID:  <20140713142738.GA25502@FreeBSD.org>
In-Reply-To: <53C290BE.8050102@beastielabs.net>
References:  <201407120747.s6C7lpYE020200@svn.freebsd.org> <20140712195452.N3279@besplex.bde.org> <53C12C1D.8080101@fastmail.net> <20140712132705.GA45964@FreeBSD.org> <53C290BE.8050102@beastielabs.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140713142738.GA25502>