22

"What is the best way to build XML in C# code?" has a good answer, and I'd like to direct "How Do I Create XML in C#" questions there, but it's closed as "Not constructive".

Is there a better question to use for this purpose?

13
  • 3
    You may trying to set up your own Q&A avoiding the mistakes of that sample. As it is it's way too broad. May be better to ask for common best practices or such. Oct 27, 2014 at 17:57
  • 13
    Canonical questions do tend towards broad, @πάνταῥεῖ (although hopefully not too broad). If the answer there is good, perhaps we can just edit the question and reopen?
    – Shog9
    Oct 27, 2014 at 18:02
  • @Shog9 Well, I've been in this discussion more than once ;-). But you're absolutely right, editing and vote to reopen seems to be a good reaction. Oct 27, 2014 at 18:04
  • 4
    An advantage to writing one's own attempt at the ideal canonical question is that it wouldn't be encumbered by various short answers from a previous age. Thus, the question and the answers to it would serve as good examples for both the issue at hand and also how to write a good question and provide a good answer.
    – user289086
    Oct 27, 2014 at 18:04
  • 4
    Other than the large number of duplicate answers, I don't see much of an issue with the question. It's the question that every developer will ask when they are first forced to create XML - "How do you create XML in C#", unless they've already searched and found hundreds of conflicting answers. Then they'll ask, "What is the best way to build XML in C# code?" Oct 27, 2014 at 18:18
  • 9
    Why does it matter that it is closed? If you like the Q+A then just use it. We don't really need more "use stringbuilder" answers :) Oct 27, 2014 at 18:23
  • 3
    Frankly, I use the "closed" flag as a "usefulness" indicator. If a question gets popular enough to (a) show up on Google as the best answer and (b) attract an admin's attention to close it because of some breach of SO protocol, that's the kind of question and answer I want to read. I'd only be unhappy if somebody actually deleted the question. Other than that, I say keep on closing 'em!
    – fool4jesus
    Oct 27, 2014 at 19:49
  • @Shog9 Imagine what would happen if we closed that question as "too broad" before people had a chance to answer. Nobody would know how to create XML from C#! Perhaps we need an exception to the "too broad" close rule for things that are universally useful.
    – mason
    Oct 28, 2014 at 20:37
  • That one wasn't even close to the first question on the topic, @mason - heck, it wasn't even the most broad.
    – Shog9
    Oct 28, 2014 at 20:41
  • 1
    This gives me an idea. Could we re-open bad questions with good answers, in the form of community wiki? Imo. this could be applied for several questions across SO. Often answered "too broad" questions is suitable for community wiki. Oct 28, 2014 at 20:53
  • @Shog9 the first part of my comment was intended to be humorous. But the point I was trying to get at is that if we had closed that question (or similar ones) then we wouldn't have these great canonical answers. I think the current close reason of "too broad" could prevent useful broad/universal questions on other topics.
    – mason
    Oct 28, 2014 at 21:20
  • 1
    Well, that raises an interesting question, @mason: was this question really too broad... or was it just broad? There's kind of a knee-jerk reaction to the mention of "best practices" that I think throws folks for a loop, but in (heh) practice it's usually just folks asking "how?"
    – Shog9
    Oct 28, 2014 at 21:29
  • I don't really have the time right now, but we should really have a discussion about this canonical XML in .NET question. In my mind, it's fairly simple: "use LINQ to XML unless you can't". But I'm sure someone will argue that we have to include XML Serialization and the use of XmlReader, and also XmlDocument, just to confuse the readers. Oct 28, 2014 at 23:11

1 Answer 1

1

The question appears to be reopened. Seems like we can go through making this the canonical answer.

0

You must log in to answer this question.

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