Boost logo

Boost :

Subject: Re: [boost] Variadic append for std::string
From: Hans Dembinski (hans.dembinski_at_[hidden])
Date: 2017-01-19 09:12:44


Hi Christof and Richard,

> On 18 Jan 2017, at 16:11, Christof Donat <cd_at_[hidden]> wrote:
> I do like the idea, but not the naming. With a function name "join" I'd expect to be able to pass an iterator range and have all its element concatenated into a string with a defined separator like this:

please don't change the name. I don't see why "join" implies iterators. "join" is a standard name for similar functions which join strings in other languages, e.g.

Python
Perl
C#
Java
JavaScript

There is also the Qt library which has a QStringList::join method.

"join" is well established and a short word, too, certainly better than "concat", which has to be abbreviated to not be too long.

I have more arguments. The word "concatenate" sounds awkward and artificial. "join" is a word you use in daily conversations, "concatenate" is not. Google search for "join" yields 3e9 hits, Google search for "concatenate" yields 3e6 hits, so you can say "join" is about 1000x more common. I personally hate technical jargon in any field. Language was invented to include, not to exclude.

Finally, "concatenate" in other programming contexts usually means that you append one collection to another collection. This is very different from what "join" does, which is piecing many individual strings and string-converted arguments together. That's clearly a "joining" operation.

Best regards,
Hans


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk