10

The site is full of examples with a few upvotes and many years of history like: Need a way to load embedded, escaped JSON strings in Python

The problem here is that the title implies a how-to question, but the post asks a debugging question - and that question doesn't quite make sense; either the problem is not reproducible or else a duplicate of something completely different and unrelated.

To explain for those who don't know Python: OP has some JSON data, where some of the strings represented by the JSON are in turn nested JSON. The question asks how to interpret the embedded data, but OP wrote some code and then reported a problem with the initial parsing. But this problem is not a real issue: the code was tried on some hard-coded data, but the hard-coded data was specified incorrectly and does not match the actual data.

The one answer given there addresses the problem in specifying the data for the example, and then goes on to talk about how to deal with the embedded data.

I would like to have a canonical that properly explains how to handle the embedded JSON data - you know, like how this question was titled. And this was the best I could find, because the site is drowning in garbage.

If I edit the question to take out the code example (so that it is only a how-to question), I would also have to edit the answer to match, for it to make sense. People will also surely yell at me for stomping on authorial intent or something.

If I treat the (debugging) question as a typo and try to get it closed, I still have no more progress towards a canonical. Similarly if I reason that there are two questions (the debugging one and the how-to, and they are unrelated) and argue for NMF.

If I treat the (debugging) question as a genuine failure to understand the problem in representing the data, then a) I have to find a canonical for that issue (and those questions are even worse - I've tried before, and gone mad with it) and b) the question ends up being closed with a misleading title. People who are actually searching about the JSON issue will end up redirected to something irrelevant.

But more than that, I seek an approach to cleaning up stuff like this that applies generally, and actually gets the site closer to having canonicals for common problems like this, that are easy to find and properly organized and generally don't suck.

16
  • 3
    I get the general issue, but for the specific question given, I'd simply close anything as a duplicate of How to parse data in JSON format, a problem of parsing nested JSON is still a problem of parsing JSON. Jan 18 at 14:02
  • 15
    You could write your own question and self-answer it.
    – Dharman Mod
    Jan 18 at 14:02
  • 3
    @AbdulAzizBarkat it seems like there are a lot of extant questions where OP understands how to use the JSON parsing functionality, but then somehow gets lost understanding what to do with the parsed result (even though it is a perfectly ordinary native Python data structure). More to the point, a lot of people just somehow don't seem to be able to wrap their heads around the idea of nesting, or of embedding, in general. I'm not really sure anything can be done about that, though. Jan 18 at 14:07
  • 1
    @Dharman I'm headed in that direction in this case. But in death by a thousand cuts style, I now have my own chat room where I account for 95% of the traffic and I have listed dozens of needed canonicals that I don't have time to make myself. And I had to do that to avoid complaints of spamming the main Python room. Jan 18 at 14:08
  • @AbdulAzizBarkat on reflection, I can address that problem by just adding my own answer to that canonical. At least, to the extent that the Stack Overflow format allows. Jan 18 at 14:30
  • @KarlKnechtel I guess an underlying issue might be not understanding what the result of the parsing is or not understanding how to access values in a python object. But that makes one wonder then how did they even get to the question of parsing JSON before understanding that. Jan 18 at 14:54
  • 1
    I wonder, too. And yet it happens constantly. Jan 18 at 14:55
  • 5
    I admire your dedication to canonicals, but I wonder if you'll encounter resistance to them anyway. There is a reason why the question "What is a Null Reference Exception, and How do I fix it" is a canonical, but no canonicals exist for any other exception types. Null Reference Exception is based on a common and fundamental misunderstanding among beginners about how objects work, and the answer is always the same. The canonical emerged organically. Jan 18 at 15:02
  • 2
    And the fact that the Python room wouldn't even let you list some candidate canonical questions is illustrative of the community's interest (or lack thereof). Jan 18 at 15:04
  • 4
    @RobertHarvey Keeping this out of the main Python room is not due to lack of interest but to keep the room useable for it's main purpose. Many regulars would be interested in cleaning up things around here but have been burned by past experiences... Jan 18 at 15:07
  • 1
    This work is very much commendable. Shipwrecked visitors from search engines on the Islands of Every-question-is-an-island-to-be-answered-as-if-no-other-questions-existed need a helping hand. Jan 18 at 18:39
  • @RobertHarvey granted that I'm only one person, but I'm not coming up with these ideas myself. I'm noticing patterns in existing questions, where a large number of vague questions, or else questions that would make sense if they weren't based on a misconception, all have the same problem at the root. Jan 19 at 1:13
  • @MisterMiyagi that was my understanding, too, but I do wish I saw more participation in my room from others - despite previous negative reception. I really do feel that analyzing the existing bad questions and mismatched canonicals, to identify what the main questions should be instead, is the first step. Jan 19 at 1:14
  • Mostly I post my answer to the title and post a comment under the question. That's the best I could do..
    – Louis Go
    Jan 19 at 7:17
  • 3
    @MisterMiyagi Please take the opposite mindset. I am perfectly capable of saturating my "good lord, there is a lot of awful stuff" detection on my own; seeing other people in the room helps me feel like other people care and are helping to do something about it. Rather, if you personally are giving up, I can't do anything about that; but know that being in "my" room would motivate me, not demotivate me. Jan 19 at 9:01

0

You must log in to answer this question.

Browse other questions tagged .