3

I have a question on how to implement some functionality. I also have multiple ideas about how it can be done, but it seems as an overkill for me, and I hope there is a better solution. So I would like to ask whether I need to implement some of these ideas (and which one if yes) or there is a better solution.

So I've asked a question, but it got downvoted and closed with:

Closed. This question is opinion-based. It is not currently accepting answers.

Update the question so it can be answered with facts and citations. This will help others answer the question. You can edit the question or post a new one

I've tried to edit it by adding an example, but no any changes.

How should such question be asked? According to the close message, it seems like I have to remove possible solutions from the question, but that would be stupid.

6
  • 6
    Write the one you feel is simplest. Ask on SO if you get stuck. Then go to codereview.stackexchange.com to get feedback once it works. Repeat with the other solutions as needed. You'll then have practical, personal experience on all and you'll be able to make the best choice for your context.
    – Mat
    Jan 18, 2020 at 14:10
  • 6
    Simple, don't ask which option to choose, ask how to accomplish the task and let others answer with the how. Asking which is the best way is inherently primarily opinion based unless you have some sort of metric for which would be the best way, in which case you could probably evaluate that by yourself.
    – Tiny Giant
    Jan 18, 2020 at 22:52
  • 1
    @TinyGiant, that means I should remove ideas about solutions? Do you really think, it will make the question better?
    – Qwertiy
    Jan 18, 2020 at 23:32
  • This is a bit funny for me. Stating your ideas in a bit different way without using the word 'which' for example 'i though about such solutions, is there anything better?' whouldn't occure in having Tiny Giant comment and probably the question wasn't closed. The funny part is in the "which" word what makes it "primarily opinion-based", where ppl closing that question could not see the latest one "Maybe there is some other solution I should try?". Besides, the end of your SO question could fall into "Avoid asking multiple distinct questions at once" and still being closed, that's the 2nd fun.
    – itwasntme
    Jan 19, 2020 at 5:27
  • That's the point where the SO didn't grow up to yet. "Write the one you feel is simplest", but the simplicity lays in the knowledge. Going to the codereview with a working but a very bad solution would still result in being downvoted. Programming is deterministic in pure meaning of this word, for all nondeterministic fine automata exists a deterministic one. Therefore, considering the environment of some future, there is a BEST way to implement such feature.
    – itwasntme
    Jan 19, 2020 at 5:41
  • 1
    I understand the "context" part of Mat's comment, but while talking about the web interfaces it's still pretty obvious - working in browser. We're passed the times where one browser supported some features where other browsers didn't. Even if we move to server side, there should be a best solution for particular environment. I just went through lots of meta and SO questions, having kinda similar concerns. In one of them I saw "what factors should be taken under concideration for best one?", I still thinks its obvious - performance, simplicity, readability - in this order.
    – itwasntme
    Jan 19, 2020 at 5:55

1 Answer 1

9

Your possible solutions should serve to demonstrate your research effort.

As written, they appear (to me) to just be a list of things that would all work to some degree and you're looking for someone else to benchmark them which would be impossible without the surrounding context about why you didn't just go ahead and use that solution.

"Which is better"/"should I prefer" is right up there with "it doesn't work" for phrases that trigger me because its impossible to answer because who knows what are the most important metrics for you. Even if we did know, that may not be very helpful for the next reader.

What I'd do is:

  • Change your example code into a Stack Overflow Stack Snippet so people can visually see the issue you're trying to solve

  • Change your solutions into a list of "my ideas so far" where each entry is "solution x but I have doubts about this because y" - the but is really important.

  • Get rid of the which should I prefer, let that (hopefully) come to a natural fruition

2
  • Ok, let's try. Revision 4. And about first point - it already was made as runnable snippet - do you mean something else?
    – Qwertiy
    Jan 20, 2020 at 12:33
  • @Qwertiy - Ah sorry, I wrote this answer on mobile and didn't see the run snippet button on that. It does appear much improved to me but I'm not too well versed in javascript
    – Sayse
    Jan 20, 2020 at 12:37

You must log in to answer this question.

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