-21

I just now asked a JavaScript question and it's being downvoted for not being able to provide a Minimal, Complete, and Verifiable Example.

I am new to JavaScript and the .js file already contains 35k lines. I find myself unable to create a minimum, verifiable example.

I have read majorly all answers on this topic and spent hours trying them but it was marked duplicate, I understand that it's a high probability of syntax/logical/functional error on my part. But sometimes because of niche experts here they can just look at the snippet and tell what might have gone wrong.

Like I was expecting there might be some syntax error which I am overlooking, some conceptual error. Comments like "looks fine it should work, there should be some error in your code", "this doesn't work with document" could have helped.

I updated my answer to mention the "login" page which I suspect could be the issue, but it seems to have been ignored. Just a strict "MCVE". So is it required 100% or the question is to be closed?

11
  • 15
    SO is not here to look at your 35k project and code review it for you, or to try to find the typo that you have in your code.
    – Servy
    Commented Nov 7, 2017 at 15:12
  • 1
    that's why I tried to abstract out the issue and not include any code snippets specific to project.
    – garg10may
    Commented Nov 7, 2017 at 15:13
  • 1
    And as a result of that you got an answer to your question. You now know how to solve the problem you asked about.
    – Servy
    Commented Nov 7, 2017 at 15:13
  • it is marked as duplicate, closed, and downvoted.
    – garg10may
    Commented Nov 7, 2017 at 15:14
  • 7
    Yes, it's closed as a duplicate of a question that answers your question, and it's downvoted because you could have easily found the answer to your question yourself by just searching for it.
    – Servy
    Commented Nov 7, 2017 at 15:16
  • 1
    I beg to differ, the approaches mentioned in the duplicate link I alredy tried applying and even mentioned in the quesiton.
    – garg10may
    Commented Nov 7, 2017 at 15:19
  • 17
    And yet you failed to explain in what way they fail to work, nor have you provided a reproducible example that demonstrates the described erroneous behavior. If/when you are able to provide both of those things, then you question would actually cease to be a duplicate of the question provided. Just saying, "it doesn't work" doesn't mean anything to anyone.
    – Servy
    Commented Nov 7, 2017 at 15:20
  • Yes, site rules require debugging questions contain enough code to reproduce the issue. See #1: stackoverflow.com/help/on-topic
    – BSMP
    Commented Nov 7, 2017 at 15:29
  • 1
    re: disputed duplicates -- see, among others, “This question may already have an answer here” - but it does not
    – Paul Roub
    Commented Nov 7, 2017 at 15:39
  • 1
    "I am new to JavaScript and the .js file already contains 35k lines" - there is your problem, right there :) . In all seriousness, however - the process of creating MCVS is often enough to answer your own question. Start replacing irrelevant functions with stubs or just constants. Generally, delete stuff and see if you still have the problem. By the time you have MCVS, you may just know what causes the problem.
    – user3458
    Commented Nov 8, 2017 at 14:13
  • 1
    the .js file already contains 35k lines mighty fine rabbit hole you got there. Just keep digging, you'll get yourself out eventually.
    – user1228
    Commented Nov 8, 2017 at 15:28

1 Answer 1

24

Stack Overflow is not meant to be a coding service. We don't look at your code and tell you what is wrong. That is something I (and I guess the majority here) would like to be paid for.

However, we are all fellow coders and we are more than happy to help you get to the solution yourself. The first step to this is to create an MCVE. Not because we like MCVEs so much, but because an MCVE is your tool to find a solution. It's not a thing you have to do for us, it is your first step in solving your problem, even if the internet burned to the ground and you find yourself offline, an MCVE is the first step to a solution.

So no an MCVE is not mandatory, but many people will see it as unwillingness to do the easy legwork yourself if it's missing. And many people are not willing to answer questions of people that want work done, compared to people who want to learn how to get said work done themselves.

So if you "find myself unable to create a minimum, verifiable example" stop right there, because that is your first problem to solve. If you cannot isolate your problem, you cannot proceed further. You must stop and solve that.


By the way: those experts that "see" what the problem is? They can only do this because they did this MCVE thing over and over and over until they could do it blindfolded. Practice makes perfect. So practice :)

10
  • 16
    I can't count how many times I've almost posted a question on SO, but decided to minimize my code to a [mcve], and suddenly I magically find the bug. It's since becomes a debugging tool of mine when feasible. MCVEs force you to actually think about what factors are effecting your code and contributing to the bug. Commented Nov 7, 2017 at 16:01
  • 2
    Providing a description of the problem and enough information to reproduce it is mandatory. You literally can't answer the question without that. Having it be minimal (or close enough to it) is not strictly mandatory to get, and is merely being considerate, but is often mandatory in a practical sense in that most people won't answer without a sufficiently small reproducible example.
    – Servy
    Commented Nov 7, 2017 at 16:03
  • 1
    Matter of fact any professional has to do it anyway, because any sane company would throw a fit if their developers posted more of their IP then absolutely necessary to a public.
    – nvoigt
    Commented Nov 7, 2017 at 16:03
  • 1
    @Servy There are many, many questions that are not strictly MCVE and still provide plenty of context to answer.
    – nvoigt
    Commented Nov 7, 2017 at 16:05
  • 9
    "So if you "find myself unable to create a minimum, verifiable example" stop right there, because that is your first problem to solve". Bingo. The culprit is already fingered too. I quote: "I am new to JavaScript and the .js file already contains 35k lines". The chance that you're going to ask an answerable question with those limitations in play is really small. Something has to change - be it how much time you've spent getting to know the tech, or how much code you have to be looking at.
    – Gimby
    Commented Nov 7, 2017 at 16:07
  • 1
    @nvoigt And those questions aren't looking for a solution to a specific problem that they have. It's mandatory in a context like this. Sure, there are other types of questions where the very idea of an MCVE doesn't make sense.
    – Servy
    Commented Nov 7, 2017 at 16:11
  • 1
    @Servy I'm not against an MCVE, I'd rather have it in more questions than less. Just saying that in the context of the post and specific code, an MCVE might be necessary or not. And I'm perfectly fine with close-voting those questions that need one but don't have it case-by-case.
    – nvoigt
    Commented Nov 7, 2017 at 16:19
  • 1
    @nvoigt No, that's just false. It's just not optional when trying to solve problems like that. It's necessary to have a description of the problem to solve the problem, and necessary to have a reproducible example of it. They're not nice to haves. Telling people to not bother providing enough information to actually have an answerable question and just claiming that having the necessary information to solve a problem is just answerers being picky and lazy isn't helping anyone.
    – Servy
    Commented Nov 7, 2017 at 16:21
  • 2
    @Servy I guess I'm not that absolutist in my view on this issue, feel free to write an alternative answer that is stricter than mine.
    – nvoigt
    Commented Nov 7, 2017 at 16:27
  • 2
    Yeah - code is not fixed by 'experts' looking at code. They sit at terminals and run their debugger and logger, making notes and then, with that extra wealth of information. they can usually isolate the problem and fix it. A bug somewhere in 35k lines? Fine, I can find it, but it's a project, not an SO question. Commented Nov 7, 2017 at 16:32

You must log in to answer this question.

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