svn commit: r268566 - head/usr.bin/users

Alexey Dokuchaev danfe at FreeBSD.org
Sun Jul 13 14:27:38 UTC 2014


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


More information about the svn-src-head mailing list