Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

In the and tags (probably in others as well), a common problem seems to be how to access specific data structures (arrays, objects). Here is an example.

How should we deal with this kind of questions? In my opinion, they are way too localized. Of course they can be seen as examples for how to access nested structures and as such might be even helpful to someone else, but foremost they only benefit the OP.

I normally vote to close these questions as too localized and flag them even from time to time, but for the example above, the flag was declined.

I'm not asking about this specific question, but in general. What does the community think?

share|improve this question
I've been voting to close them all as too localized, but a moderator disagreed with my flag on this one (don't know why). – animuson May 12 '12 at 16:08
@MrLister: The answers are specific to the instance of the given data structure and don't help anyone else. The actual problem is that people are not spending enough time to learn the basics of a language. Let's say it is a common kind of problem. – Felix May 12 '12 at 18:54
@Pekka: It seems you hate these questions as much as I do ;) – Felix May 12 '12 at 18:58
For PHP, this tool can often answer the question: – thirtydot May 12 '12 at 20:04
when there is a common problem, thing that naturally comes to mind is to establish a tag for it. Then, "canonical information" can go to, well, tag wiki – gnat May 12 '12 at 21:54
@gnat: I started writing about this in the JavaScript tag wiki, but lets be honest... those people who are asking these kind of questions are not reading the tag wiki. And unfortunately there is also no way to close a question as duplicate of tag wiki information or basic information. – Felix May 12 '12 at 22:39
well, I personally find it easy to deal with questions answered in tag wikis. No need to duplicate, I just point to tag wiki in comments, downvote and, well, close-vote / flag just as you suggested in the question - too localized – gnat May 12 '12 at 22:51
up vote 15 down vote accepted

Ideally, write a generic guide to “how do I access common nested data structures in X”, in the form of a question with an answer that covers 90% of the cases. Close 90% of the incoming questions as duplicates of that canonical question. Answer the remaining 10%, which are advanced enough to be interesting.

“Using References” in the old Perl documentation is how the answer to the canonical question might look like.

share|improve this answer
I agree this is how it would ideally work, +1. However, there are so many lazy "I need to access xyz in this structure so it looks like this, how do I do it?" questions that it's also an option to use the flamethrower on them all. – Pëkka May 12 '12 at 18:03
Theoretically, the canonical answer is that they should read this specific part of the documentation/tutorial again. For example, PHP has a nice section about arrays and how to access them. There should be no need to duplicate this. But you are right, maybe we should do this and see how it works out. – Felix May 12 '12 at 18:54

FWIW, I now decided to create a canonical answer for JavaScript:

I have a nested data structure / JSON, how can access a specific value?

share|improve this answer

You must log in to answer this question.

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