C++ Logo

sg14

Advanced search

Re: [SG14] std::colony name brainstorming

From: Ben Craig <ben.craig_at_[hidden]>
Date: Mon, 8 Feb 2021 18:14:38 +0000
> A "bundle" doesn't mean anything.
It doesn't mean much, I'll agree on that.

> My jokes about this being a British Colony
> aside, that's not what the name means, it indeed means "a distinguishable
> localized population within a species". New members of the population are
> added, old ones go away. The current name describes what it is and what
> operations (especially the population member
> addition/removal) are frequently performed on it.

I think that description applies as well to the various ordered and unordered containers as it does to the proposed container. New elements come, old elements go, and creating and destroying those elements is efficient for some measurement of efficiency. To undermine my own suggestion, those insertions and removals are also stable.

The other big thing I don't like about the name colony is that this description is something that I wouldn't guess, it has to be explained.

So, back to the name, can we find a name that tells people why they should use colony instead of one of the node based containers? "stable_" doesn't do the trick there. Fast insertion and deletion don't really help either. Fast iteration and mutable ordering seem to be the distinguishing factors here.


> -----Original Message-----
> From: Ville Voutilainen <ville.voutilainen_at_gmail.com>
> Sent: Monday, February 8, 2021 11:54 AM
> To: sg14_at_[hidden]
> Cc: Matt Bentley <mattreecebentley_at_gmail.com>; C++ Library Evolution
> Working Group <lib-ext_at_[hidden]>; Guy Davidson
> <guy_at_[hidden]>; Ben Craig <ben.craig_at_[hidden]>
> Subject: [EXTERNAL] Re: [SG14] std::colony name brainstorming
>
> On Mon, 8 Feb 2021 at 19:43, Ben Craig via SG14 <sg14_at_lists.isocpp.org>
> wrote:
> >
> > The paper talks a lot about the name colony, and that the name “bag” isn’t
> a good fit. I want to see if we can have other good names (or name pieces)
> get discussed on the mailing list.
> >
> >
> >
> > For picking names, I like using a name as a way to compare and contrast
> against similar choices. Ideally, the name should indicate why you would use
> one facility over another.
> >
> >
> >
> > The big reasons I see to prefer colony over another container:
> >
> > Pointer and iterator stability
> > Contiguous block storage for faster iteration (i.e. not a node based
> > container)
> > O(1) inserts and deletes
> > Re-orderable / sortable
> >
> >
> >
> > Reasons to use other containers:
> >
> > Contiguous elements
> > Sub-linear lookup
> > Sorted by default
> > User control over insert location
> >
> >
> >
> > I don’t see a good way to tease out the subtle contiguity differences in a
> short name. The stability aspect isn’t too hard though… “stable_<foo>” can
> communicate that… assuming we can find a suitable <foo>. The main
> downside to “stable_” is all the node based containers are already stable, but
> don’t have the prefix.
> >
> >
> >
> > I’m leaning towards “stable_bundle”. “bundle” communicates a bit of
> disorganization. It still sounds like a container (“a bundle of ints”). I don’t
> think it has strong precedence in CS unlike so many other names. “bundle”
> as the root is still rather arbitrary though. Neither part of the name
> communicates that fast iteration is a key aspect of the container.
> >
> >
> >
> > We could attempt to fill <foo> with something that indicates the expected
> implementation strategy. I’m less fond of that approach, but it can help
> communicate the design of the container. I can suggest “stable_skip_array”
> and “stable_skip_list”. I’m not overly fond of “array” or “list” in the names
> though, as they suggest layouts that aren’t entirely accurate (single large
> allocation and individual element allocation respectively). I’m not fond of
> “bucket” since that has precedence in our hash map apis, though I could live
> with “stable_bucket”.
> >
> >
> >
> > A thesaurus item to start from:
> https://urldefense.com/v3/__https://www.thesaurus.com/browse/array?s
> =t__;!!FbZ0ZwI3Qg!6PSl3xmiCIw13vUxgBlQIWwJLuTh1PtpUrVobqduIdbNO3
> vbX1LeWJjOk6MI$ . I’ve browsed over list, container, and aggregate for
> other ideas.
> >
> >
> >
> > Are there other aspects of the container we should look at for naming?
> Any suggestions for affixes or roots for a multi-part name?
>
> A "bundle" doesn't mean anything. My jokes about this being a British Colony
> aside, that's not what the name means, it indeed means "a distinguishable
> localized population within a species". New members of the population are
> added, old ones go away. The current name describes what it is and what
> operations (especially the population member
> addition/removal) are frequently performed on it. No "skip_*" name
> describes that as well - such names get into implementation weeds, rather
> than describing the higher-level semantics of the type.
>
> So unless there is a superior name that keeps the higher-level
> descriptiveness, keep the current name.

Received on 2021-02-08 12:14:46