-7

I was browsing SO, and found the following question (not mine)

Can we return a String in a PHP function

Now this question immediately got downvotes. It is not my question, but if i would face the similar problem this is similar to how I would formulate the question. I was surprised to see it downvoted.

In my goal of understanding the mechanics of SA voting behaviour a bit more, how can someone ask a question similar to here in way which will not cause downvotes?

Edit: It seems that the main reason for downvotes is is that people don't read his question correctly. He is not asking which method is better, but simple if the first method is allowed (in the title) or if it has certain downsides which he does not see (in the question).

17
  • Well, I don't know much PHP, and that is not gonna change. Nevertheless, looking at that code, I don't understand why the OP thought there would be any problem and, indeed, the OP had tested both alternatives and they both worked. If had PHP, I would probably close-vote as 'Unclear', (what you think the problem is with basic syntax). Apr 8, 2018 at 22:35
  • 1
    the question is clearly opinion based since there is no issue, so am not suprised that it get downvoted as it will simply lead to discussion with no clear answer. [it's already voted to be closed with 2 votes and i added mine now] Apr 8, 2018 at 22:38
  • 1
    That is true, but at the moment of asking OP doesn't know that. He just sees a lot of people using one method (probably by coincidence) and asks if there is any downside in using another method. There isn't ofcourse, but he doesn't know that. He also doesn't ask which is better, just if there is a downside to one. It feels to me that he is punished for being a beginner in PHP and not knowing the answer to his own question. Apr 8, 2018 at 22:42
  • 3
    but at the moment of asking OP doesn't know that --> he should know that if he read the help :) ... he sould know that such question is clearly off-topic and even if his a beginner, when the question will get closed he will know the reason. Also a downvote is not for bad written question only. Apr 8, 2018 at 22:49
  • 1
    @TemaniAfif I meant that he didn't know that the difference between the methods was purely opinion based. Apr 8, 2018 at 22:52
  • maybe but when i read this I have two methods to do the same and both the methods work i understand that he has two working alternatives and when i look into his code i clearly see that there is small difference [i am experienced with PHP] ... so in his context there is absolutely no difference between both code, BUT the question may be a great one if both code were invloved with another one as in this case we may see a difference. It's like it tell you which is good between a++ or ++a ? both are the same used alone BUT used in for loop they give different result and we may face issue. Apr 8, 2018 at 23:01
  • 1
    He asks if there is a difference. Saying there is not should be an answer to his question, not a reason to downvote in my opinion. With this reasoning you are expecting him to know the answer to his own question in order to determine the quality of his post. Apr 8, 2018 at 23:09
  • 8
    Indeed, this seems like a textbook case of people not understanding that while something can be a matter of opinion, whether or not it is is a fact (notwithstanding people with opinions so strong they consider their opinions as fact - that only serves to cement the fact that different people have different views). I've had a few accepted answers that amount to nothing more than "They are functionally equivalent and whichever you choose is personal preference." - sometimes that really is all the asker wants to know.
    – BoltClock
    Apr 9, 2018 at 3:04
  • That question may be a better fit for Code Review
    – Jan Doggen
    Apr 9, 2018 at 9:22
  • 1
    @BoltClock Part of the problem is that when faced with these types of questions too many people can't help but post an answer with their opinions, so these types of questions still, very often, attract opinionated answers, rather than merely answers stating that the choice is a matter of opinion and leaving it at that. And of course, as Makoto says in the answer, the question isn't asking for behavioral differences, they're asking what "caveats" might exist, which has lots of very subjective answers.
    – Servy
    Apr 9, 2018 at 13:56
  • 1
    @user3053216 It depends on the situation. I have indeed seen lots of questions asking about the difference between two things, when there is a difference, that still just results in people posting their opinions about what they like, and ignoring any actual behavioral difference, as a result I consider "what's the difference" questions to rather rarely be useful, or at a minimum, very hard to ask well. Most people don't succeed in asking them well enough to get objective answers. They also have the problem of very often being too broad, in the cases where they're not opinion based.
    – Servy
    Apr 9, 2018 at 16:00
  • 1
    @Servy Well, i would argue that if there is a clear difference between the two, he would not be responsible for people ignoring the site rules and posting an offtopic discussion. Especially if it is possible to give a clear objective answer as well. Apr 9, 2018 at 16:07
  • 2
    @user3053216 At the end of the day what matters is whether or not a question actually attracts useful answers. If a question, or type of questions, tends to attract answers that aren't useful, that's a problem, even if it's theoretically possible for the question(s) to have useful answers that in practice aren't actually posted. We want the site to be actually useful, not potentially useful.
    – Servy
    Apr 9, 2018 at 16:09
  • 1
    @Servy Did you look at the answers? There are no subjective discussions there. The downvotes are purely based on potential harmfull answers (which would break the site rules if posted) Apr 9, 2018 at 16:36
  • 2
    @user3053216 There's one answer, it contains a few facts and a whole lot of personal opinions and subjective statements. So yes, I looked at the answer. Did you?
    – Servy
    Apr 9, 2018 at 17:06

1 Answer 1

6

How do you ask a question that is entirely subjective and up to a person or shop's coding style as to which one they use or prefer?

I don't think you can, really.

If the question were asking about what those approaches were, that's answerable since it's narrow, it's highly objective (someone may not have seen early returns before), and I'm certain that a duplicate exists somewhere.

Since the question asks which approach has caveats over another, this becomes incredibly subjective and shaky, since there are some people in the world who swear by early returns, and some who swear by "one" return approaches. Both have their place in code and both are useful. Both are subjective holy wars which have no actual outcome.

This is kind of the razor-thin line that we draw in the sand over subjectiveness. It's easy to mistake this kind of question as on-topic, but given that they're literally asking us "which is better" (indirectly through "what caveats are there for approach 1"), it's just too broad.

Downvotes are really appropriate for a question like this. Honestly, a close vote as "primarily opinion based" would be enough, too.

17
  • 2
    It is by far not a subjective question. He asks, are there downsides to this method because i don't see it being used as much. The answer then would be: No, it is a personal preference. If people see it as a sign to start discussing which they prefer then those people did not read correctly and should be downvoted. Apr 9, 2018 at 9:49
  • @user3053216 Did you just say "if people see it as [...] then they did not read correctly and should be downvoted"? We vote on content, not users!
    – E_net4
    Apr 9, 2018 at 12:07
  • @E_net4. I said that if people misread a question and because of that go into an offtopic discussion in the answers, yes they should be downvoted. Don't see anything wrong in that Apr 9, 2018 at 12:50
  • 1
    @user3053216 Well yes, discussion in the answers is a clear sign of the question being off-topic, and voting can happen accordingly. But that doesn't really defend the question itself: if it attracts opinionated answers, it is unlikely to be in good condition for Stack Overflow.
    – E_net4
    Apr 9, 2018 at 12:53
  • @E_net4 It is a sign yes, but downvoting should not happen based on a sign of it being not a good question. A sign of bad quality should be a reason to examine the question better Apr 9, 2018 at 15:54
  • 1
    @E_net4 I agree with user3053216. This feels like confusing the symptom with the disease.
    – duplode
    Apr 9, 2018 at 16:14
  • 1
    @duplode Ok, we could ignore the correlation. But do you disagree with Makoto here? The fact that opinionated answers should be evaluated with that in mind doesn't really justify (or let's say, bring a better light to) the question, in my opinion. My initial comment was orthogonal to the elephant in the room.
    – E_net4
    Apr 9, 2018 at 16:27
  • 1
    @E_net4 (1) It is not a case of ignoring the correlation, but of recognising correlation does not imply causation. (2) I don't think the diagnosis in Makoto's answer (more specifically, in the paragraphs starting with "If the question [...]" and "Since the question [...]") is wrong, but it does feel like a case of a question with inessential subjectivity, in which a simple rephrasing would be enough to bring it back behind the "razor-thin line" without essentially changing its intended meaning.
    – duplode
    Apr 9, 2018 at 16:42
  • @E_net4 If he worded the question as: Is there any behavioral difference between the early return and the return once method? What would you think of this? Apr 9, 2018 at 16:47
  • @user3053216 Personally, I would still expect a bit more reasoning than just stamping those sentences. In particular, would just "No." be a valid answer to that question? Ultimately though, I stay away from PHP questions.
    – E_net4
    Apr 9, 2018 at 17:04
  • 3
    @user3053216: You effectively change it into a duplicate, which makes me kinda shrug. The question would still be closed, and the user might have a better lead on information...but I don't see it being worth the effort of reopening.
    – Makoto
    Apr 9, 2018 at 17:05
  • 1
    @E_net4 Yes, "No" would be a valid answer. Btw i don't see how your aversion of PHP is in any case relevant to this discussion. Apr 9, 2018 at 17:47
  • @Makoto I'm not speaking about reopening, i don't care about this question since it is not mine. But how is my formulation a duplicate of a valid question and his is not? The only thing i added was terminology and focus on preventing subjective answers. The former is impossible without specific knowledge and the latter one is a reminder to follow the site rules, which would not be the responsibility of the asker. Apr 9, 2018 at 17:50
  • @user3053216: Remember, I said that the line is razor thin. It's subjective to ask about which is best. But it's fine to ask about what these things are. Since the asker doesn't know yet you as a passer-by would, if you believed that the question were redeemable, then an edit to clarify it would have pacified the outstanding concerns. Maybe the OP has no outside context into this, which is where we would have to stand in and provide at least a little more guidance.
    – Makoto
    Apr 9, 2018 at 17:54
  • @user3053216 Consider reading this Meta question. If a question cannot avoid the mold of a yes/no question, that is certainly an issue. Moreover, you asked me what I would do to the question under certain circumstances, and my answer to that was complete.
    – E_net4
    Apr 9, 2018 at 17:58

You must log in to answer this question.

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