-9

Why is this off-topic?

How to check how many Fridays where there till the current date?

It's essentially asking to help improve an algorithm. The question is clear and makes sense (to me). It could potentially be considered a Big-O problem as well if it were reworded as such.

8
  • Since the question is so clear, what is the problem that it's looking to solve? You even said yourself in a comment under the question that it's unclear what the question is asking, so it's odd for you to now say it's clear (since the question hasn't been edited).
    – Servy
    Dec 27, 2017 at 18:58
  • 2
    From the question: I want to know a better solution. Or, is there an algorithmic improvement that can be made to the code? Maybe to turn it around on those who voted to close - what about the question makes it impossible to provide an answer?
    – Yuck
    Dec 27, 2017 at 19:00
  • @Servy Neither of my two comments on that question indicate that I think it's unclear what's being asked.
    – Yuck
    Dec 27, 2017 at 19:01
  • 1
    As someone else indicated in the comments, the question would be better asked on Code Review; otherwise this can't be answered correctly, as there is no single correct answer to "can you do this better". See also Are questions asking for “The best way” always primarily opinion-based? Dec 27, 2017 at 19:24
  • 4
    This cannot possibly be worse than the typical way such a question gets asked. "I have no idea how to do it, halp". Like this one. Should have been the dup vote btw. Dec 27, 2017 at 19:25
  • 2
    Hah! If they just ask how to do it they would doubtless get a barrage of "what have you tried" and if they provide what they tried they get shunted to code review. Dec 27, 2017 at 19:35
  • 1
    @Yuck Yes, the question asks for a "better" solution. And what's "better". Someone else suggested what they thought might be better and you decided to chastise them for having a different definition of "better" than you did, definitively demonstrating that the question is unclear because "better" is entirely subjective, vague, and not sufficiently well defined to get an answer. So that's how your own comment demonstrated that the question isn't answerable.
    – Servy
    Dec 27, 2017 at 19:42
  • @MikeMcCaughan Better fit for code review makes sense. Thanks for linking the other meta question as well.
    – Yuck
    Dec 27, 2017 at 19:54

1 Answer 1

7

From the question itself:

but I want to know a better solution

That makes sense to me in the sense of I know what the words mean, but I'm having a difficult time trying to focus on the problem in the absence of what the OP considers to be suboptimal about the (working) solution that they presented.

Now it could just be that I'm not one of those extremely smart, extremely algorithmically-minded people that would see the working code in that question and begin screaming at their monitor (and I suspect I'm not alone there) and in the absence of that kind of inspiration, I'm kind of lost when it comes to writing the kind of answer that says yes, this question has a place here. The premise of "does improve this code belong" aside, the question seems to be missing a very important component, what the OP thinks is wrong with it in the first place. My initial reaction would also be to close based on not enough information being provided.

Does it have a place? It looks like some answers might be saying it does, but I really hope someone clarifies the question a bit to better match what the answers bring to light for someone else being faced with that kind of problem. That's why folks can (and seem to be) voting to reopen it.

It's kind of hard to give a blanket answer on the on-topic merits of questions that give code and state a clear problem (even if the code works) .. but this one sort of fails at the second half of that out of the gate, and I think that's what folks are reacting to.

1
  • 1
    I think often this type of question depends on the answer. Suppose the OP was trying to get the number of days between two dates and presented code looping through with a counter variable. There is an "obviously" better way presented here Dec 27, 2017 at 20:41

You must log in to answer this question.

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