-15

I asked on Stack Overflow about a concurrency implementation in Go (the deleted questions is at https://stackoverflow.com/questions/77809075/implementation-in-go-for-multiple-concurrent-http-requests). I gave the background of the problem and my question was focused on how to implement the multiple spawning of HTTP requests using Go routines since my Go background is shallow as a newbie. At the first 10 minutes or so, I got downvoted, then in the next hour or so, I got a second downvote. Today I see that the question was closed because of three downvotes.

My question was not lengthy, and the actual content was just in two paragraphs, so I don't consider these as a blah-blah question. What I don't get is why I got downvoted three times which led to the closing of question. What is considered a "good" question in Stack Overflow's point of view?

13
  • 19
    "closed because of three down votes"—Questions are closed by close-votes, not downvotes. Also you might consider not deleting your question if you're asking for people's viewpoints on it.
    – khelwood
    Commented Jan 13 at 9:44
  • @khelwood Where can I see the close-votes? All I saw was that my question was at -3 at the votes on the left and that it was closed. Commented Jan 13 at 9:46
  • @khelwood About the not delete part, yes, you are right. It was an impulsive response when I saw that the question was closed. Commented Jan 13 at 9:49
  • 16
    You don't need to see the close-votes to know that downvotes don't close questions.
    – khelwood
    Commented Jan 13 at 9:49
  • 6
    Screenshot of deleted question
    – VLAZ
    Commented Jan 13 at 10:12
  • 16
    The question doesn't seem to include any details to what the real task is. Just broad description of what sort of should happen. I personally can't even tell what is supposed to happen - you have a bunch of files all around and you need to do what with them? You mention HTTP request and using them as input. Suggesting you call something with the files? There is a mention of a response but what should be done with it? Is your task "find all files that match something on the disk, then for each make an HTTP POST call and supply the content of the file in the body"? Or something different?
    – VLAZ
    Commented Jan 13 at 10:19
  • 14
    This seems like something you should try, see how it works and if you encounter problems you can't fix, you'd ask a question at that point. Commented Jan 13 at 10:22
  • The files are used as input for each HTTP request, each one as a HTTP request POST parameter. My main issue is not working with the files, but is how to implement the concurrent HTTP requests with go routines and the use of channels. Granted, it's a bit abstract, what I need is a bit of directions on how to implement this. Commented Jan 13 at 10:23
  • 10
    OK, so my interpretation is wrong. But I hope you can see how that isn't really me making up, but me struggling to figure out what the question is. That should indicate that the question does require more clarity.
    – VLAZ
    Commented Jan 13 at 10:34
  • 10
    As a side note, there's a good amount of noise in that question. The opening paragraph and the final sentence aren't needed.
    – Thom A
    Commented Jan 13 at 11:00
  • 7
    "my question was focused on how to implement the multiple spawning of HTTP requests using go routines since my Go background is shallow as a newbie" Please reread your question trying to put yourself into the shoes of someone who does not know this. How much of the information in the question would lead you to read the question as this versus otherwise? Would you identify the same question topic or something else, even if it were related? Would you correctly identify the level of detail expected? Commented Jan 13 at 11:28
  • 4
    FWIW, it is totally unclear to me just what the problem is. From your problem description, there is zero interaction between goroutines/requests, meaning no shared information, meaning nothing to exchange via maps or channels. At most (in other words this is me wildly speculating on your needs) this might need some mechanism to limit the number of concurrent requests, which would be the Y to the X you wrote about in the question. Commented Jan 13 at 11:34
  • 4
    FWIW2, it is totally unclear to me just what your expectation is for this meta-question (hence a lot of comments). It is very much focused on your specific question, with a mix of justification for the question and asking about the downvotes, but the tags and what you explicitly ask is very general on a hypothetical good question. The is a lot of guidance on the latter, so an edit to seek specific feedback may be more productive for you. Commented Jan 13 at 11:41

1 Answer 1

20

A good question is a question that is clear for everyone, on-topic, useful for future visitors and answerable in a few paragraphs.

Your question has three paragraphs and a closing sentence.

First paragraph:

I'm new to the Go language and I have a small project that I'd like to write it in Go mostly as a practice, but if it turns out to be good enough, I will use it in the future. Here's the deal:

It doesn't matter what your motivation is to post a question. It doesn't matter for the answer, it doesn't matter for future visitors that try to solve the same problem. Remember the tour? This site is all about getting answers. It's not a discussion forum. There's no chit-chat.

There are a bunch of JSON files scattered in a series of directories. What I want is to read all these files and use them in HTTP requests as POST input. The HTTP response (JSON encoded) is just a boolean flag if all went ok and a string indicating the error in case that something went wrong. I already have this written in PHP and it's a bit slow, since it runs in a serialized order. I thought that go routines would be a way to make this faster and spawn a concurrent number of routines that make the HTTP requests and wait for the response. What troubles me is how to implement this in Go.

What troubles do you have? Reading a file? Creating an HTTP request? Decoding JSON? Determining the difference between a boolean and a string? Performance? Waiting for the response?

I'm thinking of reading all the files in a map structure (the files are small, the size of all of them in the directories is 11MiB) and depending on the number of routines that I need spawned, feed each one with a item from the map. I've read that maps are not concurrent safe, would this be a problem in this case? Would a channel help where I feed the channel with the content of a file while reading all the files from the main thread and having the routines read from it?

Great ideas. We don't know yet if channel can work, but you're the first person to give that a try and then ask about any issue you run into. The same goes for the use of a map. There isn't any harm with using it and then raise a question on an issue found.

Ideas would be greatly appreciated!

I think this is the main problem. Questions on Stack Overflow are not great for gathering ideas. You're more or less in the design phase and that requires a whiteboard and brainstorming. That is simply not covered here. Chat, Discord, and forums are better equipped to handle that.

This basically sums up why a question that is clear to you and where responses would have great value for you, isn't well received by the community. Idea generation and/or where-to-start type of questions aren't deemed a valuable addition to the body of knowledge we build here. This due to the broadness of such question, lack of one right answer and no lasting value for visitors to come.

Once you have code that compiles, but doesn't work as hoped, we're happy to take questions to help you get those specific programming issues fixed.

4
  • Ok, fair enough. Just tried to be a little friendly, next time I won't be. And it seems that my question here wasn't very popular either, so, the 9 (so far) downvotes. It seems that some people got irritated of what I asked, so instead of leaving a comment, they downvoted and off they go, going to the next question by another poster, not even bothering with this one anymore. Commented Jan 13 at 14:00
  • 7
    @VasilisLourdas I'm not sure if you're in the mood for feedback on your meta question but it does read a bit between a subtle rant and a trick question. If you had simply asked: I've gone over the how-to-ask guidance and thought my question would be on par for the main site, yet it was not well received and got closed. I'm not sure what is wrong with it, I would love some feedback to see if and how I can improve it I'm sure the reception would have been better. But that is too late to fix now. Maybe next time.
    – rene
    Commented Jan 13 at 14:15
  • I accepted your answer, since it seems valid to me and you took the time to write it down and present your views. Other than that, everything else seems to have no other meaning at this point. Commented Jan 13 at 14:26
  • @VasilisLourdas fair enough.
    – rene
    Commented Jan 13 at 14:57

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