-11

I'm sure this subject has been done to death and I'll be down-voted into oblivion, but I've just had a question put on hold because:

Questions asking us to recommend or find a tool, library or favourite off-site resource are off-topic for Stack Overflow

My main objection to this is my personal experience - there have been many answers I've found very useful that suggest a library for solving a problem and I've also noticed that these types of questions have often been marked off-topic. Thankfully those questions aren't deleted as I've gained something from them. Here's an example of a question I gained useful information from recently (although I admit that it is phrased a little too heavily toward opinion): https://stackoverflow.com/questions/5374570/whats-the-best-ios-oauth2-framework I am now using the AFOAuth2Client library, thanks exclusively to this question.

In the case of my question, it didn't seem anyone has asked how to solve this specific problem before. I also implied in the question that the solution may be an external library (as opposed to API code) but that either would do. It seems that if I had done LESS research into whether it could be achieved using the built in API and left the question more open ended it would have been left open.

So, given that these questions are clearly helpful to the community (based on my own experience and the up-votes such answers receive) provided they are phrased correctly (and thankfully we have old ones that weren't censored) - why are we closing them?

For reference, my question: https://stackoverflow.com/questions/20564026/how-to-validate-a-json-schema-in-objective-c

17
  • Related : meta.stackexchange.com/questions/139399/…
    – Walker
    Dec 13, 2013 at 12:22
  • 4
    You have to disguise your question when you are willing to accept an library suggestion as an answer see this as an example
    – rene
    Dec 13, 2013 at 12:23
  • 4
    @rene hit the nail on the head. Your question could very well be closed as not showing a minimal understanding or not showing code you are working with too. So start there with your actual problem and let people recommend a library if it's appropriate. Dec 13, 2013 at 12:26
  • I would say my question is pretty open ended and therefore 'disguised' enough to not be asking for opinions on best libraries. I would happily accept a method not using an external library. I don't understand how we can close questions because they ask for opinion when that's all SO is any - opinions on how to solve problems - that's why we have voting - people have opinions on whether code is good/bad
    – Sam
    Dec 13, 2013 at 12:27
  • @MatthewGreen I'm attempting nothing at the minute, I've googled and found no real solutions (but should I include the fact I googled in my question?) This is a pretty atomic process I'm looking for - validate my JSON. I either write a validator, or I use some function validate_json. I haven't started writing a validator, because I'm hoping I can be pointed by someone (with experience) to my desired validate_json function.
    – Sam
    Dec 13, 2013 at 12:29
  • 1
    So then your question can go along the lines of "I'm trying to validate this JSON against a schema. This is what my JSON and schema look like. I'm not sure how to validate this though in my language." It doesn't assume libraries or anything. It strictly addresses the problem and then lets people answer with code or a library or whatever. Dec 13, 2013 at 12:32
  • @rene "You have to disguise your question" is that really the aim of SO?
    – Sam
    Dec 13, 2013 at 12:32
  • 2
    "that's all SO is any[way] - opinions on how to solve problems", strongly disagree with your definition of an opinion.
    – OGHaza
    Dec 13, 2013 at 12:33
  • 1
  • @MatthewGreen JSON schema is a defined thing - providing my schema is irrelevant (although I accept I could also include a draft version I am targetting). Also, the problem is stated in the very first sentence, shortly followed by two open-ended questions which cover answering in code OR a library. To any layman it's obvious that both kind of solutions are acceptable - this seems pedantic.
    – Sam
    Dec 13, 2013 at 12:37
  • 1
    @Sam No, the aim is to have questions that are practically answerable. My 'disguise' is ask for a solution with the option for other libraries, not to ask for libraries. Some question can rule that out 'I'm not allowed to bring in external libraries'
    – rene
    Dec 13, 2013 at 12:41
  • @rene well in that case my question shouldn't be closed - I intimated that the solution may be using an internal API (NSDictionary) and I'm sure this makes it obvious that other internal solution would be acceptable (although I doubt any exist).
    – Sam
    Dec 13, 2013 at 12:43
  • Well @Sam I disagree. I see text about a schema, json and checking/validating. That is it. I don't see a simple code sample of a NSString and a NSSchema being fed into an NSDictionary and calling Validate on it that would illustrate your text. Have a look again at my answer and its original question. And also for this comment goes: I have no knowlegde of Objective-C, c++, ios (which probably shows) and I want to keep it that way.
    – rene
    Dec 13, 2013 at 12:50
  • @rene - exactly my point, I don't know of any way of using NSDictionary to solve this (nor of any internal API, but my best guess would be that this would exist in NSDictionary, if at all). Hence I have provided no code to attempt it. However if someone wants to come and tell me how to do that, I'm open to it. Equally if someone want's to say "use this library, like this" then great too. The thought process seems to be: "there may be more than one library to solve the problem and therefore more than one valid solution and therefore opinions -> close it!"
    – Sam
    Dec 13, 2013 at 12:53
  • 1
    Why don't you show the code were you end up with the NSDictionary and say: 'Hey, no validate?' and that you tried NSJson.Validate, NSSChema.validate whatever, but show some code. I'm pretty sure the time this discussion now has taken would have given you enough minutes to produce such a trivial code sample, judging your knowledge on the topic based on the responses here. To be clear: In its current state I will not vote to reopen that question.
    – rene
    Dec 13, 2013 at 13:02

2 Answers 2

11

Disclaimer: I'm one of the users who voted to close the question.

To understand why your question was closed, it helps to analyze it sentence by sentence:

As the question says, I have a schema and I would like to verify that the JSON received from our server matches it.

Fair enough so far.

Does NSDictionary provide any way of doing this?

Two problems here: no apparent research effort (you do not say if you tried to search for ways to coerce NSDictionary into doing that) and no code sample (so we cannot see if and how you tried to adapt NSDictionary to your specific needs, and we don't have any context about your existing code).

Do any open source libraries exist in Obj-c, C or C++?

Final problem: this sentence asks us to recommend or find an open-source library that can help you achieve your goals. Unfortunately, under our current rules this makes the question off-topic for Stack Overflow.

I was presented the question in a close vote review, so what was asked of me was to determine if the question should be closed. From its content, it was indeed the case, either because you didn't show what you tried or because the question asked us to recommend a library, depending on which of the last two sentences carry the most weight.

Of course, the question still can be improved so it can be reopened, but I'm afraid there is no chance for that to happen in its current state.

4
  • re: Research effort - fair enough. It was quickly obvious to me that there is no was of doing this, so I didn't include the fact I searched for it. It was so obvious that I didn't consider it necessary. I didn't want to exclude this type of solution though, on the off chance I missed something. re: the final problem - I think an answer to this question would be beneficial to the community and I suppose this is what my question here is about.
    – Sam
    Dec 13, 2013 at 13:37
  • @Sam, I believe explaining in your question how you found out there was obviously no way of doing that with NSDictionary would have qualified as research effort. Regarding recommendations for libraries, this is off-topic because most of the time no canonical answer exists, and you will end up with several users advocating their library of choice, which was deemed not constructive enough for Stack Overflow. Dec 13, 2013 at 13:40
  • hmm, so even though I'm not exclusively asking for a library, that's still of topic? Just because one possible answer is a library? Also, users advocating libraries is something that's helped me and others in the past on SO. I'd prefer there was a Wikipedia-type warning that the question may contain opinionated answers.
    – Sam
    Dec 13, 2013 at 13:54
  • @Sam, indeed you're not exclusively asking for a library, but the other half of your question (Does NSDictionary provide any way of doing this?) would also have resulted in it being closed as off-topic, only with the reason becoming Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results instead. Dec 13, 2013 at 13:57
0

Yes, they are generally off-topic.

Questions asking us to recommend or find a tool, library or favourite off-site resource are off-topic for Stack Overflow.

On Stack Overflow you can ask about e.g. bugs while using library. Questions to help in searching for proper library are off-topic and should be closed. You can always use Google or try to search related page is Stack Exchange Network.

1
  • 2
    You've just quoted the rule I was questioning back at me.
    – Sam
    Dec 17, 2013 at 20:36

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