I've asked a question that has been answered and then closed.

To me, it's a quite specific question with a good answer.

I know what an AST is and I know how to build it in a few languages, but this time it was too much effort for my needs.

Should I edit the question in some way to make it more acceptable to the community?

If so, what specifically can I do to better convey that I have a minimal understanding of the problem?

Note that:

  • I wasn't asking for code, just hints.
  • I'm used to Irony (and Parsec, and Groovy) for DSLs, but you know, they are not the cheaper approach here.
  • I did already considered regex, but I hoped that an even better/faster solution had come from collective intelligence.
  • I asked here because I usually ignore closed questions when looking for info in SO, and I was wondering if somebody with a similar problem could find the answer useful.
  • 2
    Add what you tried and where you are stuck in the process. Currently you are just asking for code.
    – juergen d
    Dec 9, 2013 at 16:15
  • 2
    Did you read the close reason and the linked article? It's pretty clearly defined there. At the moment, your greatest incentive to rewrite it is that users continue to have the option of downvoting the question for poor quality. I doubt that'll happen, though linking to a question on Meta has been known to generate a wave of interest (and voting).
    – JDB
    Dec 9, 2013 at 16:19
  • If it's already been answered, then why does it need to be reopened? Questions only need to be open if they're unanswered, right?
    – user102937
    Dec 9, 2013 at 17:01
  • Ok @TheGrinch, that's a proper answer to this question. I usually ignore closed questions when looking for info in SO, but that's me. Write this down as an answer and I will accept it. Dec 9, 2013 at 17:04
  • Aw, maan. You're gonna make me write a real answer?
    – user102937
    Dec 9, 2013 at 17:05
  • 1
    @TheGrinch - I can think of two other reasons: 1) We like quality, relevant content on the site. This question appears to be neither. If the OP is willing to edit it into something quality and relevant, I don't think he should be dissuaded (afterall, the close reason asks home to edit). 2) The question, being of rather poor quality, could continue to attract downvotes. Probably not, but it's still a reason.
    – JDB
    Dec 9, 2013 at 17:11
  • You should probably be editing that list into your original question, not into your Meta question.
    – JDB
    Dec 9, 2013 at 17:31

2 Answers 2


In response to your comment:

@JBD: not only why, but also how. Indeed I can't see any issue comparing my question with the checklist. – Giacomo Tesio 7 mins ago

Let us take a careful look at your question:

I have a file containing data produced by string.Format(), one per line, something like:

Class1 [ Property1 = 123, Property2 = 124 ]
Class2 [ Property4 = 'ABCD', Property5 = 1234, Property6 = 10 ]
Class1 [ Property1 = 2, Property2 = 3 ]
Class2 [ Property4 = 'DEFG', Property5 = 2222, Property6 = 19 ]

and so on...

I need to parse them back to obtain the instances of the classes.

Given that I have the original string.Format template used to produce such lines, what's the fastest way to obtain back the original values so that I can build back the instances of Class1 and Class2 (for fast here I mean in terms developer's time)?

PS: I can rely on the fact that all input strings are "well formed" according to the template.
PPS: I know that using JSON would make this simpler, but right now I can't. Moreover I know Irony too, but I'm looking for something even faster (if possible).

And compare it to the checklist:

  • Have you done some research before asking the question?

    Perhaps you have done some research on "the fastest way to obtain back the original values so that I can build back the instances of Class1 and Class2", but you've not shown any evidence that you've done so. From the reader's perspective, this first item would have to be: no.

  • Have you explained what you've already tried to solve your problem?

    You've not shown any attempts you've already made to solve this problem. You've not included any research attempts (articles, etc) nor any code ("here's what I tried and it isn't working/is too slow/etc"). So again, no.

  • If your question doesn't include code, are you sure it shouldn't?

    Since it's a question expecting code in the answer, it should almost certainly have code in the question. No.

  • Have you read the whole question to yourself carefully, to make sure it makes sense and contains enough information for someone coming to it without any of the context that you already know?

    No. You clearly know a good bit about the topic, but based on user comments, there was a lot you didn't bother to say in your question.

It's hardly the worst question I've ever seen, but there are several ways you could fix this. In the end, it comes off sounding like you want someone to hand you a solution (meaning, give you code you haven't written yet) rather than help you fix a problem (with code you've already written).

Keep these general rules in mind:

  • If you want code in the answers, you should have code in the question

  • Ask questions about code you've already written. Post that code (or some slimmed down version of it) and explain, in detail, what's wrong with it. If it's too slow, provide a theory as to why. If it won't compile, include the complete error message. Etc.

Or, think of it like ordering a drink:

  • I want a Woodford Reserve, neat

    We know exactly what you want, and we can come up with a good solution for you (we don't have Woodford, but Chattanooga Whiskey is similar)

  • I want something sweet

    Um... would you like a milkshake?
    "No, I'm lactose intollerant."
    Oh, okay. How about a soda?
    "No, I don't like bubbles."
    Umm... would you like to look at the menu some more and I can come back in a few minutes?

  • Where exactly did I asked for code? I'm used to Irony, Parsec and Groovy for DSLs, but they are too much for this use case. I considered regex, but I hoped that a faster approach did exist. Dec 9, 2013 at 16:56
  • 2
    @GiacomoTesio - Can you think of an acceptable answer which would not contain code, or at least a description of how to code? Personally, I would have closed this question as either "Primarily opinion-based" (since you are explicitly asking for the fastest, which generally leads to debate and polling) or "Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow" (since you seem to want some kind of pre-packaged solution, like a stripped down version of Irony).
    – JDB
    Dec 9, 2013 at 17:05
  • Although, after this conversation, I would probably have to go for "Unclear What You're Asking" since it's really not clear what you want in the answer.
    – JDB
    Dec 9, 2013 at 17:06
  • No, regex was enough. Indeed I accepted the answer provided. I just hoped for something faster to code, something like a string.UnFormat(). :-) Dec 9, 2013 at 17:10
  • @GiacomoTesio - So you were expecting code. ;)
    – JDB
    Dec 9, 2013 at 17:11
  • @JDB... lool :-) Dec 9, 2013 at 17:15

When asking a question, one thing to have in mind is it's consistency with Stack Overflow's philosophy: See the About page:

With your help, we're working together to build a library of detailed answers to every question about programming.

How does your question contribute to it?

You're asking a question with respect to the developers you have to hand. It's not a specific programming question so will effect a limited, if any, contribution to the Stack Overflow knowledge base. It's also likely to attract answers that are more to do with the opinion of the answerer than anything more objective.

See also

Take a look at Jon Skeet's blog on asking the perfect question.

  • I think the question has more to do with "Now that I've got an answer, why should I go back and edit it?"
    – JDB
    Dec 9, 2013 at 16:22
  • 2
    @JBD: not only why, but also how. Indeed I can't see any issue comparing my question with the checklist. Dec 9, 2013 at 16:25

You must log in to answer this question.

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