39

I have this question, Is there an identity index value in JavaScript, and it got closed because it needs details or clarity. I did all I can, and it seems to not be well-liked by the community.

What can I do to make it better?

Also, what could be some reasons it is downvoted, and what can I do to perhaps get upvotes on the question?

15
  • 37
    you might have more luck asking it somewhere on Computer Science than on Stack Overflow - I am somewhat of an SME, and the only comment that comes to my mind is "yes, but why..?". The problem statement is bizarre for a practitioner of JS - which shows from the responses to the question on main. Thank you for approaching the feedback in a constructive manner, though - it is a rare sight these days. Oct 5, 2021 at 2:17
  • 2
    I edited this question to ask for dislike reasons. I really need to get upvotes because I am question-banned so I am in a tough situation.
    – Shivam
    Oct 5, 2021 at 2:20
  • 1
    on a related note (I am not sure how far you are in your JS journey), but object identity and, subsequently, comparison, is not a trivial matter in JS. So a prerequisite for properly answering this would be determining what object equality means for you in this specific case. You can "brand" objects uniquely in JS (and Symbol will, indeed, help you with that) and then check for the presence of the brand but there is nothing that would work "out-of-the-box" so to speak Oct 5, 2021 at 2:24
  • 3
    Sorry, my initial edit removed mention of votes, and bans, since such questions tend to be negatively received on meta. However, that seems to be relevant to your question, and that's perfectly valid, so I've added that wording (and tag) back in.
    – cigien
    Oct 5, 2021 at 2:33
  • closer to your original question on main, it also bears to mention that an object (or its extension, an array) is a set, so the standard semantics of what "identity" means applies here too. If you concatenate an empty array to an array, you will get an array of the same size with the same number and order of elements - which satisfies the definition of an empty set being an identity element of a set in a union operation. In JS's terms that would mean [ ...[1,2,3], ...[] ] is the same as [1,2,3] which makes [] an identity element. However, the knowledge of this is pragmatically [1/2] Oct 5, 2021 at 2:35
  • [2/2] useless in terms of programming in JS since the result of spreading an array is a copy. The closest you get to "identity" on arrays is performing an in-place operation like [1,2,3].push(...[]). And the only thing that comes to mind regarding plain objects is Object.assign({ a:1, b:2 }, {}) [in-place] or spread properties ({ ...{ a:1,b:2 }, ...{} }) [creating a copy] Oct 5, 2021 at 2:40
  • 4
    @OlegValter Did you mean to post your last 2 comments as an answer on the linked main question? ;)
    – cigien
    Oct 5, 2021 at 2:44
  • @cigien eh... well... no, actually not :) I was trying to explain why the question might not be well-received and got side-tracked into what an identity element would mean for an object or an array. In abstraction from the question at hand, the problem is actually quite interesting, I'd say even fascinating. And that's not even touching Set and Map built-in objects Oct 5, 2021 at 2:45
  • 6
    "What can I do to make it better?" Search much more before. This question can probably be answered with a few searches. If this fails, one really should include the attempts, if only to make it easier for others to continue with the search. Oct 5, 2021 at 8:06
  • 24
    "How can I make my very downvoted question more well-received?" Post about it on Meta :DD Oct 5, 2021 at 9:49
  • 1
    This is what happens when SO doesn't have a "this question is not wrong, it's not-even-wrong" close reason
    – Hong Ooi
    Oct 5, 2021 at 19:37
  • 2
    The question is confusing now because of your example.
    – TheMaster
    Oct 5, 2021 at 23:37
  • 2
    Slightly off topic, I see that the linked question is currently at +28/-25, which has put the OP in the "top 0.28% this week" on SO! Does that reputation boost count even though the question has been closed, or will it be removed?
    – skomisa
    Oct 6, 2021 at 4:25
  • 1
    @skomisa Reputation is completely unaffected by question closure. One can lose reputation when a question is deleted, but only if the score is less than 3, or it was deleted less than 60 days from the time it was posted. (The same thing applies to answers as well).
    – cigien
    Oct 6, 2021 at 5:03
  • 1
    @TamásSengel That will backfire if the question is really bad. This question is borderline. The question score is still 0(29/-29) and OP is likely to stay question banned, if score < 1 regardless of reputation gained.
    – TheMaster
    Oct 6, 2021 at 8:50

3 Answers 3

32

From my point of view, the problem with this question is that it is asking for something that both looks quite trivial, and seems to show some lack of basic research, and maybe more importantly with little to no application.

I don't think it is "unclear" though, and thus I did vote to reopen, but I don't think it is a "good" question either.
Probably if you could show a practical use for this knowledge, that could make people receive the question better.

9
  • 1
    Ok, I edited my question. Now, how do I kindly let the downvoters maybe reconsider my question?
    – Shivam
    Oct 5, 2021 at 2:05
  • 21
    You don't, either they'll come back by themselves, either you let it go. 4 downvotes is a sign that your post was not well received, but it's not the end of the world either. Now that your question is linked to this meta post it will gather more visibility anyway. However, regarding your edit there, I don't think it sufficient to make your question a good question. Your example is unclear (it doesn't even uses the notation you are asking for).
    – Kaiido
    Oct 5, 2021 at 2:08
  • 2
    I completely understand. This question was mostly sparked from my curiosity so I don't really have that much of a good use case for it. I still don't quite understand why it was so disliked.
    – Shivam
    Oct 5, 2021 at 2:11
  • 17
    @Shivam please check out stackoverflow.com/help/on-topic, in particular "and is a practical, answerable problem that is unique to software development" - that "practical" part aligns very poorly with "I don't really have that much of a good use case for it" and I'm sure most people who understood what you trying to achieve agree on your sentiment to your question - totally non-practical and trying to use answer in the code (if one exists) would lead to unreadable mess... Oct 5, 2021 at 5:15
  • 1
    "I still don't quite understand why it was so disliked." People probably just thought that knowing this wouldn't be very useful. I tend to agree. But you got your answer, so at least your curiosity was satisfied and the question is ontopic and will remain for others to see. What more can one desire? You even didn't lose reputation overall. Oct 5, 2021 at 8:09
  • @Trilarion At +10/-10 OP should get 80 rep. Although OP 's issue seems to be question ban, in that case it should not factor in the question ban algorithm.
    – user202729
    Oct 5, 2021 at 11:59
  • 10
    I've noticed as well that when a question attracts its first downvote, others are very quick to follow, it's like when some people see a -1 questions it burns their fingers to drow it further. Oct 5, 2021 at 15:03
  • 14
    It just means that if one person finds something downvote-worthy, it is likely that there exists another person that will find the same thing downvote-worthy. There is nothing "magical" about voting. And negative feedback loop is a very common phenomenon too, nothing new or specific to SO too. Oct 5, 2021 at 15:05
  • 4
    @Aude: Yes, the first vote (up or down) carries a lot of weight (effectively). Oct 6, 2021 at 6:59
17

On top of what Kaiido wrote about the question looking trivial, lacking research and serves no obvious use case, it does not even strike me as something helping to understand the language either. To be completely honest, the question just looks like you got a sudden thought in your head and immediately threw yourself on the keyboard to type a question about it.

To me, your question is a bit like asking if there's a negative number that's greater than 5. Or if there is an "identity parameter" for a command that creates a file with its own file name as the content.

But I have to admit that for some reason I cannot explain, I still find your question a bit fascinating. I guess it at least partly is because I'm very fond of mathematics.

An advice for the future. If you wonder something about programming that lacks use case and only is for curiosity, then say it. Make it clear that your aim isn't to use it in production code.

I quite often ask questions about the intricacies of C. That's a language where it's quite good to know if something is legal or not, even if you have no intention of using the "features". A good use case for this knowledge is to know which things to prioritize when you refactor a code base. Here are some examples of my questions:

Is it UB to return a pointer to local variable?

Is it ok to pass an int array to scanf and printf when using the %s specifier?

Is it safe to do something like foo(x, &x)?

Is it undefined behavior to use functions with side effects in an unspecified order?

1
  • 1
    I think the question is fascinating exactly because it "looks trivial" on the surface.
    – JonSG
    Oct 6, 2021 at 16:51
2

Don't be fooled into thinking your question is bad just because it got a lot of downvotes. Likewise, heavily upvoted questions are often not good ones either. Case in point.

IMO, your question was much better thought out/researched/conveyed than this wildly (and almost unanimously) popular question that must be "the epitome of quality" by SO's standards based on the extreme vote count.

I think your question is fine.

1

You must log in to answer this question.

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