15

is ambiguous. The current tag wiki says that the tag should be used for C++11 std::initializer_list, which is a specialized feature. It has been like that pretty much since tag creation, but the tag is used for all manner of other questions.

In particular, both C and C++ has a formal syntax item called initializer-list, which is the most common use of the term both in general and in terms of C++. This actually looks like the most common use of this tag on SO as well.

I propose the following:

  • Create a separate tag for the purpose of C++ std::initializer_list questions only. Move the current tag wiki to this tag. Tag usage: must combine with , recommended to use or later.
  • Re-tag all current std::initializer_list questions to use the new tag.
  • Change the meaning of initializer-list to refer to the syntax item initializer list both in C and C++. I can write a new tag wiki for this. Tag usage: must use either or .

I can fix this myself, but I wish to poke the community for feedback before I go ahead.

We have 1128 questions using the tag, out of which 29 questions are neither tagged C, C++ nor C++11. Are there other languages where this is a formal term? I see a few Javascript, Python and C# questions with the tag. Are they using the tag incorrectly?

10
  • 5
    In the same vein as todictionary, are std::initializer_list's really special enough to deserve a distinct tag?
    – vandench
    Commented Mar 16, 2022 at 13:33
  • Darn it Lundin, I was thinking that you were also the user that proposed to remove todictionary and asking myself "why the same user doesn't apply the same logic"?
    – Braiam
    Commented Mar 16, 2022 at 13:50
  • 1
    Wrt "Are there other languages where this is a formal term?" dart also uses the term initializer list
    – Henry Ecker Mod
    Commented Mar 16, 2022 at 14:02
  • 3
    @vandench Yes it is special enough and also got a corresponding header file with the same name. A large amount of the questions using the tag are actually using it as indicated by the tag wiki. We could use the existing tag for multiple purposes, but that is usually not a good idea - it's effectively used like that already. Expanding the existing tag wiki would require the least effort however.
    – Lundin
    Commented Mar 16, 2022 at 14:52
  • Btw both C and C++ have specialized rules regarding initializer lists that are unique to each language. C got the designated initializers, which have not historically been part of C++ (but were finally added in C++20 iirc?).
    – Lundin
    Commented Mar 16, 2022 at 14:54
  • What are the rules around using language feature tags across programming languages? Is it wholly dependent on what the tag wiki says? Commented Mar 17, 2022 at 2:27
  • @ryanwebjackson There's no clear policy there. Abstract and generic terms exist in multiple languages, obviously. C and C++ are related so they have a lot of features in common.
    – Lundin
    Commented Mar 17, 2022 at 7:28
  • 1
    Do we need tags for header files? Are answerers to questions about this topic being disserviced if they don't have this tag? Top users list for this tag suggest that they just answers [c++] indiscriminately and the titles usually include the necessary keywords.
    – Braiam
    Commented Mar 17, 2022 at 14:00
  • If a user is interested in this language feature, it seems specific enough to each programming language that it would be confusing to browse questions from all languages featuring the tag. Therefore, I conclude that it should go away. However, if std-initializer-list is valuable to C++ developers and is used, then I think your first bullet point is a good one. Commented Mar 17, 2022 at 14:19
  • @Braiam Not really but in case we have a tag for a header file, then that tag can be used for everything contained in that header. It can remove the need to create a tag per function etc. In this specific case the header and the feature have the same name though.
    – Lundin
    Commented Mar 17, 2022 at 14:24

1 Answer 1

3

As a frequent C++ user I endorse having both tags. They are distinct, easily confused concepts, and the dual usage has caused me heartburn several times. I've tried to read through the top scored questions to brush up on std::initializer_list and been annoyed by the constructor initializer list questions being mixed in. And vice versa.

2
  • This was my spontaneous reaction too. I actually ended up writing this meta after tagging a C question about initializer lists with the tag, then stopped to read the tag wiki. Do you think creating a tag std-initializer-list is a good solution then?
    – Lundin
    Commented Mar 18, 2022 at 7:29
  • I do, and I like the name. Commented Mar 18, 2022 at 13:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .