There’s a vocal contingent of Stack Overflow users who are convinced that ‘easy’ questions that don’t demonstrate ‘research’ by the asker don’t deserve answers. However, the site software does not allow for a possibility of a question being closed merely for being ‘easy’. So the voters simply use whatever means are available to them to make the question go away, regardless of whether the site feature was designed for it or not: vote to close as ‘not reproducible’ or ‘needs details’, vote down, and if the score is −3, vote to delete. There was nothing unclear about your question; the votes to close were tactical ones.
To be clear, I think this is nonsense. The only kind of ‘research’ that should be absolutely required of askers is that they know what they are doing: they understand enough of their tool and of their problem domain to know their way around a problem and understand a clearly written answer. They should be able to know what a literal, a variable or a function is. They should not be wondering what a loop is in the middle of implementing a sorting algorithm — unless the question is specifically about how loops work.
I have no sympathy for ‘do my entire homework exercise for me’ questions, for copy-paste programming, or programming by permutation, where the asker has no desire to learn anything and just wants a ready-made solution to plagiarise, but anything short of that is fair and square in my book.
And in fact, even the ‘easy’ questions are sometimes only superficially so. This is a pretty good example of one: many users here seem convinced that solving the problem is simply a matter of splitting the value of the PATH
environment variable on every occurrence of the ;
character and then checking string equality. But as this answer points out, that would be wrong, because PATH
entries on Windows can be quoted, and quoted entries can contain ;
as a normal character. And pathnames need to be normalized for e.g. spurious or non-canonical path separators (C:\WINDOWS\
, C:\\\WINDOWS
, C:/WINDOWS
), and other things. Accounting for those possibilities will complicate the code enough to make the task not so trivial any more, and reveals reasoning to the tune of
hmm well it's not clear to me whether you want to know how to read environment variables, or whether you're trying to do a substring comparison, and since that makes it two questions in one, you know what, have a close-vote and first go figure out what you actually want to ask by yourself
for the fallacious folly it is.
It is telling that one of the canonical examples of the so-called XY problem is also pathname manipulation. I think it’s worth appreciating askers who go out of their way to avoid falling into the trap of ‘oh, it’s just a string’.