-19

Composer called via doApplication mingles stdout and stderr

Why could this question be downvoted?

Is it badly put? Could it be improved? If not, could the downvotes be cancelled?

I usually just delete questions when they are downvoted but this time I don't feel it's justified.

16
  • 15
    Because two people found it unclear, not useful, lacking research, or they lost their keys.
    – Kevin B
    Nov 2 at 13:51
  • 1
    The comment by Yivi could be shedding some light on why someone may downvote it, if the problem is "incidental" to the cause you presented, they could feel you didn't do enough to narrow down the problem thus resulting in asking about a part of your solution that is unrelated to the problem.
    – Kevin B
    Nov 2 at 13:54
  • 12
    That's a pretty poor overreaction because of a few downvotes. Note also that this site never guaranteed an answer to your question in particular. This post might help you understand the situation.
    – E_net4
    Nov 2 at 15:35
  • 1
    that's not something that changed recently, the site has always been that. However, the number of answerers has certainly trended downward for the past... 8 years? 9 years?
    – Kevin B
    Nov 2 at 15:39
  • 5
    Now that it is deleted you will definitely not get an answer anymore - which is too bad because with the Meta attention the question got chances are that an actual expert would have seen it and answered the question or pointed you to a duplicate.
    – Marijn
    Nov 2 at 15:44
  • 6
    IMO asking a question on meta for 1-2 downvotes is quite an unnecessary (and unwise) step. People here can't really answer why your post got downvoted unless they are the one who did so, you also attract more scrutiny on your question and the meta effect. Nov 2 at 15:49
  • 1
    Nah. If people care enough to downvote but not to answer then I am outta here with the question.
    – chx
    Nov 2 at 16:26
  • 11
    Just to be clear: asking for help has never been welcome on this site. Such questions get closed or the plea for help is removed if the question is otherwise ok. The site strives to be a repository of information, not a help desk.
    – Dharman Mod
    Nov 2 at 17:21
  • Side note: This "poor overreaction" probably doesn't come from a reaction to a couple downvotes; it's more likely a build-up over time and is neither poor nor an overreaction. Whether it's justified given the goals of the site vs chx's use and expectations of Stack Overflow, I don't know enough PHP or chx's usage history to have a say in the matter. Nov 2 at 18:57
  • 2
    @Dharman, I see questions like OP's on meta.stackoverflow often (and have asked a similar one myself a while ago). Speaking as a newer user, I think part of why confusion occurs is mixed messaging from Stack Overflow as an entity versus Stack Overflow as a community/userbase. For example, the guide on how to ask a good question says "we are happy to help you" which implies to me that asking for help is reasonable here. Why users asking for help is unwelcome was only clear when it was explained to me (as you say) that SO is a repository, which isn't prominently described on the main help pages.
    – Jay Bee
    Nov 3 at 0:22
  • 1
    @chx - If you continue to ask a question and then delete the question you will eventually be question banned. Asking and then deleting a question isn’t positive behavior. You always want to address the reason a question is poorly received instead of just deleting it. Nov 3 at 6:08
  • 1
    @SecurityHound there is no way 10K+ user will get any automated ban for Q/A whatsoever to my observations.... We are immune to that part of throttling. Nov 3 at 16:23
  • 4
    It’s still really annoying behavior to ask a question then delete it. Nov 3 at 20:26
  • @SecurityHound and then people complain that no one wants to provide feedback :) Indeed not many people willing to write though out feedback knowing that the post will be deleted as soon as a useful hint of a solution is provided... I thinking to welcome ChatGPT "answers" as those count for "more than one answer" blocking deletion. Nov 3 at 22:02
  • I've seen a few users in the low thousands get banned, but it's few. Nov 3 at 22:34

1 Answer 1

5

I do not normally look at PHP questions because I have no interest in PHP and at most passing familiarity with it. But on review I voted to close this question as Needs Details or Clarity. Since "unclear" is also part of the list of reasons offered on the tooltip for downvoting questions, I can guess that others felt the same way.

It arguably also doesn't have a proper MRE, and thus Needs Debugging Details. Finally, since the issue seems so fundamental (you appear to be trying to use one specific bit of library functionality to launch another process, and want to do something specific with the output of that process), that the question ought to be a Duplicate once properly understood. But again, I don't know the PHP canonicals so I can't help with that.

I am calling composer show from my plugin like this

This doesn't give proper context for the problem. What is the plugin plugging into? (Is the fact that it's a plugin, actually relevant to the problem? Can you reproduce the problem more directly?) What's "composer" and what does it have to do with PHP? (Would the problem be the same if you were trying to run any other arbitrary program in the same way?) Someone else edited to add tags based on subject matter expertise and guesswork. We shouldn't have to do that. We shouldn't have to read tags in order to understand the basic context of a problem, either.

[code]

What's $this? Why should it have a getApplication, which has a doRun? Rather than trying to have the context of the code be implicit according to the framework you say you are using (you don't even say that! Someone else had to guess tags to add!), please show code that includes necessary imports etc. and enough setup to where someone else could copy and paste the code, without adding or changing anything, to see the exact problem, directly.

How could I separate stdout and stderr or suppress stderr completely?

This doesn't clearly explain what went wrong when trying the code. I guess you mean that stdout and stderr of the called process were intermingled in some way. We should be able to see a proper example of what happens when you try using the code, and what should happen instead; and it should be clear how that differs.

It also isn't clear to me how you come to this conclusion that there is a problem at all: by examining $showOutput after the call (and how, exactly), by considering what you see in the terminal, or something else.

I just need the JSON.

This makes no sense by itself. My first thought was that you want to know what to use to initialize $args, so that when the rest of the code runs, you can specifically extract the stdout. Of course, that syntax isn't JSON, but I can imagine people describing it that way. But on a closer read, I assume you mean something like "the stdout of this process will be JSON data and I want to capture it in $showOutput. This should be made clear by framing the question with some minimal context (maybe something like "I want to use ... to call composer show, which should produce JSON output on stdout. I have this code: ... I expected to get a result like: ... but instead [$showOutput has the wrong value / something shows up in the terminal that I want to suppress / etc.]").

11
  • 9
    Meh. The question has issues, sure. But I wouldn't say it's "unclear" for a subject expert. The idea that a subject expert would be asking themselves "what's composer and what does it have to do with PHP" is rather ridiculous. And frankly, does not really need a full "MRE", IMO.
    – yivi
    Nov 2 at 14:17
  • @yivi I try to cast a wide net with these reviews generally. It seems clear you're the subject-matter expert here so I trust you on those points. Nov 2 at 14:20
  • The question would have been crystal clear for anyone dealing with these because it said "call composer show from my plugin " and the code was a copy of how to call other commands from the manual. I just need the JSON. -- This makes no sense by itself. It sure does, the command was called with format json, hence a json response is expected. But thanks for your answer, it clearly shows why SO became completely unusable. There shouldn't be any need to expand a question like this that only experts can answer.
    – chx
    Nov 2 at 15:36
  • 6
    " it clearly shows why SO became completely unusable." - if you imagine that Stack Overflow is a place where you go to ask your specific question to get personalized help from experts (who in turn you expect to apply their expertise to understand your meaning), sure. But Stack Overflow is not that, by design. That's how a discussion forum works. Stack Overflow isn't a discussion forum, it's a Q&A site; the purpose of questions is to help contribute to a searchable reference library, which means other people who find the question with a search engine should understand it. Nov 2 at 15:53
  • This answer was peak SO for me. From the votes, it's quite clear no one had this problem since yet there was an answer and a stellar one in less than twenty minutes. Peak SO.
    – chx
    Nov 2 at 16:25
  • 4
    I mean, I've been around since 2010 myself. How things used to be is explicitly not indicative of what is now considered the "design" of Stack Overflow - if you read the old blog posts, it's clear that Atwood and Spolsky were experimenting and didn't really know what they're doing, and they freely admit it. Over the years, the Meta community has figured out what actually works and makes the site valuable. Over 5% of my reputation comes from an answer to a question that blatantly needs more focus and that I've been trying to get deleted for a while - it also has over 2 million views. Nov 2 at 16:35
  • 4
    (And that's after extensive editing - revision 1 of that question was a barely coherent, barely-in-English mess.) Nov 2 at 16:36
  • Interesting how that is. It's not like the less coherent the question, the more useful it is to people, but the simpler the problem, the more likely more people hit it, search for the answer, and find it here in response to a question I probably would have dismissed as "K&R beat this to freaking death on page 17 of the C Programming Language. Don't they teach the classics anymore?" Nov 2 at 18:46
  • @user4581301 There are countless questions and answers on Meta already explaining why we do, in fact, want trivial questions on Stack Overflow - as long as they are suitably clear, focused, objective and not duplicate. IMX the C tag community is especially bad at accepting this, which has a lot to do with how I ended up writing What is a beginner-oriented canonical Q&A and how can it help me curate my watched tags?. Nov 2 at 18:48
  • I totally get that. I routinely catch myself doing what I'm railing against. Not everyone is being taught from the same book. Not everyone's getting good, or even acceptable, instruction. I'm probably a bit bitter because when I catch myself dismissing a simple question and correct the mistake, someone else has written a good answer by the time I'm done looking for a duplicate. Nov 2 at 18:53
  • 3
    Re "composer": That is unfortunate naming (using (nondescriptive) common nouns as names of products (which is not understandable in the age of search engines). Chef, Puppet, Blade, Burn, or Bun, anyone?) and usage. The name is "Composer" (capital "C"). The name of the executable is "composer". Nov 3 at 1:41

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