14

In a recent request, I split tag usage between and based on the grammar of the language the question refers to, so we have some sort of established criteria to back me up when I say that is being misused.

There are several questions here that refer to JavaScript's spread syntax. Perhaps this tag can be narrowed for use with R's spread function. Or perhaps we blacklist and move questions referring to R's spread function into to decrease the ambiguity of a vague word?

I'm open for suggestions, but at the very least the JavaScript questions need to be properly retagged. There's a lot of them, so I thought bringing attention to this first would be prudent before bumping a bunch of old questions with tag edits.

Update

So we have one suggestion to (if I'm interpreting this correctly) have language-specific tag names for spread operators/syntax? I personally think that adding a tag-wiki to and/or renaming it to , , or whatever name we can agree on, would be the proper solution to this, since there is an established history for the usage of spread-* rather than *-spread, which I think would only add to the confusion.

Further Update

I've put in a lot of work retagging from to whatever was the appropriate tag, mostly , sometimes , , or even in a couple cases (for Spread.js). Anyway, I think is getting closer to a homogenous usage, but I still propose we add a wiki to reinforce the proper usage.

6
  • 1
    To get a conversation going, can people viewing elaborate on specifically what they do / don't like? I want to address as many concerns as possible when dealing with this. Commented Sep 4, 2018 at 10:44
  • 1
    Why don't we take back one step, and wonder if we need a [Spread] tag in the first place? I have a feeling that this might just as well go down the same path [goal] did here: meta.stackoverflow.com/questions/317120/…
    – Luuklag
    Commented Sep 4, 2018 at 14:55
  • I don't think the spread operator is necessary from a JavaScript perspective. It's a small language feature - not sure it warrants a whole tag?
    – Ian
    Commented Sep 4, 2018 at 15:08
  • @Ian I can see you're not a frequenter of JavaScript. Let me tell you it is the sole source of a lot of confusion, and I among multiple high rep users that frequent JavaScript watch that tag for questions. It is very useful to keep spread-syntax. Commented Sep 4, 2018 at 15:47
  • If nobody objects I'm going to start editing JavaScript and TypeScript questions out of spread Commented Sep 6, 2018 at 23:49
  • 36 non R related [spread] posts. stackoverflow.com/…. Once retagged, we can rename the tag as r-spread. (At a very high level search, looks like the tag can just be dropped from all those posts)
    – Bhargav Rao Mod
    Commented Mar 11, 2019 at 1:48

1 Answer 1

4

You have caused it ... You could simply use Groovy-spread as a name for * instead of spread-operator. The use of "spread operator" is just ambiguous. Many programming languages are using that (mostly incorrectly). For example the ... in Java is varags but it happens that people refers to it as "spread operator". Same happens in JavaScript. In JavaScript, we should use "spread syntax".

After reading your comment about Kotlin (I am not so familiar with it), I figured out that it uses the "spread operator" wording too. I quote from this Kotlin reference

When we call a vararg-function, we can pass arguments one-by-one, e.g. asList(1, 2, 3), or, if we already have an array and want to pass its contents to the function, we use the spread operator (prefix the array with *):

So keeping the current name "spread operator" is still ambiguous. There may be other uses of "spread operator" in another programming language (the "splat operator" from PHP (denoted as ...) or Ruby (denoted as *) comes in mind).

So, edit the tag name with a more precise naming.

Btw, I just noticed that the tag description is not correct.

Please do not use this tag to refer to the spread syntax "..." in JavaScript. Use [spread-syntax] instead. In Groovy, the spread operator (*.) is used to invoke an action on all items of an aggregate object. It is equivalent to calling the action on each item and collecting the result into a ...

That is not correct. *. is a spread-dot operator. The spread operator itself is a simple *. I see that the documentation says something different. However, if you check the operator precedence table, you will see the correct terminology (sorry for being squarey about providing hand-drawn circles)

enter image description here

edit 1: added response to Kotlin comment + my figures about the wording "spread operator" in other languages like PHP/Ruby.

6
  • 1
    Well I was asked to write the tag-wiki for spread-operator, which I think is silly since obviously my knowledge of groovy is very limited. I also think it's a bit of a stretch to say this usage is my fault when the majority of JavaScript questions involving spread-syntax are indeed going under the correct tag. The reason the other tag is being used is because there's no tag-wiki guiding its usage, not because spread-operator is suddenly unavailable. Commented Sep 4, 2018 at 10:15
  • And since we're pointing fingers, the reason I thought that was the name was due to this very official looking documentation. Again, I'm no expert at groovy by any measure. Edit Oh, I see you've already found that. Yeah that was my source. Commented Sep 4, 2018 at 10:17
  • 1
    @PatrickRoberts there is a sentence in my post: I see that the documentation says something different with a link. Please do not feel offended, you just did not see it coming. There are also been incorrect uses of other tags on SO because people barely reads tag descriptions... I just proposed an edit. My post appears a bit harsh it seems. My apologizes.
    – KarelG
    Commented Sep 4, 2018 at 10:23
  • Just so you're aware, spread-operator also includes the Kotlin spread operator, so renaming the tag probably isn't going to happen. But editing the tag-wiki to refer to the correct operator would definitely be helpful right now. Commented Sep 4, 2018 at 10:30
  • I've made a tag-edit suggestion to spread-operator with the following new description for groovy: In Groovy, the spread operator (*) is to extract entries from a collection and provide them as individual entries. This can be useful for converting collections to individual parameters on method calls. quoted from javaworld.com/article/2074149/core-java/… Commented Sep 4, 2018 at 10:55
  • 2
    I renamed spread-operator to groovy-spread as mentioned in this answer. That should reduce some of the mistags in that tag.
    – Bhargav Rao Mod
    Commented Mar 11, 2019 at 1:46

You must log in to answer this question.

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