9

Today I noticed that a question I made 4 years ago was closed as opinion based, and I am really struggling to understand the rationale for this.

The question essentially asks what is the difference between using X vs using Y, and what is the difference in performance between the two.

Essentially, the answer is that there is no performance difference and therefore which you use is a matter of taste.

I agree that the question would be opinion-based if it was: "given that X and Y are equivalent, which one should I use?". But the question is not about that, and the answer is certainly not based on an opinion: "the underlying machine code has to perform a jump anyway" and therefore X and Y are equivalent.

I did not know at the time that X and Y were equivalent, and a lot of other people also did not know (or do not know). The answer is independent of opinions, it was at the time relevant to me and others, and is the only thing being asked in the question.

I don't see how this question is opinion based, but maybe I am missing something fundamental about the meaning of opinion-based here. Could someone elucidate this? Because if it is opinion based, then I prefer to have it deleted.

3
  • This reminds me when a similar post was being closed as Opinion Based and Tim Peters edited his answer to get real ;-) Nov 13, 2016 at 11:20
  • 5
    Any perf question that doesn't talk about a specific language and runtime is highly problematic. Even on simple code like that. The accepted answer is based on the premise "terminates the execution of the current function". It just doesn't, not after a C compiler's optimizer has inlined the function. "has to perform a jump" is not correct either, code generators for RISC cores (like ARM) tend to favor their conditional execution feature to avoid branches. So nobody is learning much and it degrades to "don't worry your pretty little head about it, use the style guide". Not great Q+A. Nov 13, 2016 at 14:30
  • 2
    Do consider rolling back the edit that removed the [python] and [c] tag. At least you picked a target language Nov 13, 2016 at 17:12

2 Answers 2

3

I think that many people missed your real question here, and since many of them might know that there's no difference, they didn't take time to understand your question and got mislead, especially from the "should I use .. or .." part.

I don't think the question should be closed, voting to repoen.

3
  • I believe that if they where mislead, is not their fault, but the flawed wording of the question.
    – Braiam
    Nov 13, 2016 at 11:02
  • 3
    @Braiam Meh, while it was indeed worded in a suboptimal way, it did ask a pretty specific answerable question in the first sentence even before your edit: "which of these two is faster", which seems on-topic to me. Could the OP have done better? Sure. But I also think the reviewers should have been more careful rather than just blindly voting to close. Nov 14, 2016 at 6:43
  • "which of these two is faster" is not even the question OP is asking! He is, as his own comment points out actually looking if they are equivalents. There isn't any "metric" which he included that would make one "faster" than the other, and frankly, those kind of questions without that tend to invite an absurd amount of answers (each of them using their own benchmark) or opinions ("I think..." answers), which is why we don't like them. See Gorilla vs shark examples.
    – Braiam
    Nov 14, 2016 at 11:26
1

difference between using X vs using Y

Read Gorilla vs Shark for a why. Basically, you worded your question the wrong way, and how you ask your question is as important as what you ask. This happens all the time in the form of people asking for a tool (or a tutorial) that do X, instead of asking how to do X, and people asking what is better between X or Y, instead of asking under what circumstances should X be used instead of Y, or as in your case, which is more efficient X or Y, when you were interested to know "Are X and Y equivalent from a compiled or scripted code perspective?".

I edited the question to reflect that, and that should fix the wording that invites opinions. However, note that there are answers that don't even adress the question as it's asked, because as it was open to interpretation (even after my edit, it still is) because I lack the information to actually fix this. If you want to ask if two things are equivalent, you should provide more context, particularly the compilers and interpreter you are interested in, as JS is a scripted language it can behave differently depending the engine used (V8, the mozilla one, etc.), and with compiled languages is still the same, for example C code can be compiled differently if it's clang or gcc or intel's compiler, etc.

While my edit addressed the wording that can be interpreted as asking for opinions, it's still able to get closed based on missing information.

1
  • Thanks for the edit to the question. I agree that it is better worded and reflects better the question intent. Nov 13, 2016 at 11:15

You must log in to answer this question.

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