I just visited this post on SO, here's an excerpt for containment sake:

Ways of formatting an AngularJS directive template

What ways of formatting do you use for formatting templates in AngularJS directives?

This question is meant as an open document to get inspired for cleaner code.

… *****

These two methods are probably the most common to most AngularJS developers, any other suggestions or awesome ideas?

***** The ellipsis encapsulates an elaboration on several ways to approach the issue, each with their advantages and disadvantages.

That post felt out of place on SO, but when I flagged the question for closing, I couldn't point out the exact reason, and I ended up ticking the other option and leaving a reason which, in retrospect, felt a little offset:

This question appears to be off-topic because it lacks a real problem, and is more suitable in the library's documentation.

This led me to try and depict precisely why questions like this should be closed, and propose it as an additional reason for closing. Here's a more refined phrasing:

This question appears to be off-topic because it lacks a specific problem, and instead attempts to serve as a reference, or refers to ways of usage, best-practices or differing approaches. Its content is more suitable in a forum, a wiki, or a user-guide for a product, a tool, or a library.

Should this be added to the list of close-reasons?

  • 1
    When you discuss a question on meta, please leave a link in a comment on the question. – Gilles 'SO- stop being evil' Mar 19 '14 at 0:21
  • 6
    Asking “why the downvote” under a post is completely unproductive. If the downvoter wants to comment or answer, they'll do it without prompting. If they downvoted and moved on, they'll never see your comment. Also, note that downvoting is different on meta; downvoting a feature request is a usual way to say “this shouldn't be implemented”. – Gilles 'SO- stop being evil' Mar 19 '14 at 0:23
  • right, @Gilles, thanks for the elaboration! – Eliran Malka Mar 19 '14 at 0:35
  • No, comment on the question on the main site, so that the asker and anyone else involved (such as potential close voters) knows that there's a discussion going on. Like this. – Gilles 'SO- stop being evil' Mar 19 '14 at 0:42
  • @Gilles, yeah i got that after visiting the question on the main site again.... thanks :) – Eliran Malka Mar 19 '14 at 0:56
  • 1

You don't need a predefined close reason to specifically address every possible situation under the sun.

If you feel that the question should be closed because it is likely to result in statements of opinions rather than facts or references, choose “primarily opinion-based”.

If you feel that the question should be closed because it is too open-ended and thus cannot reasonably be answered by one person, choose “too broad”.

In any case, write a comment. When you need to explain why the question is unsuitable, write a comment.

Avoid picking “off-topic” for a question that isn't off-topic. A question about writing AngularJS directive templates is clearly about programming. If it's unsuitable for the Stack Exchange format, use one of the corresponding close reasons (unclear, too broad or primarily opinion-based).

In your comment, explain why this question, specifically, should be closed, in reference to the generic close reasons.

“It is more suitable elsewhere” is not an explanation. It's a complement, something that you can add at the end of your comment after you're explained why it is not suitable here — and then go directly for “it is more suitable in <location>”.

The basic problem about Ways of formatting an AngularJS directive template is that it's asking for everybody's favorite way of formatting. This is too open-ended for Stack Exchange, it's calling for a poll or list. However, there is content to the question that is suitable here: a reasoned comparison of the two approaches mentioned in the question. When a question can be adjusted like this, prefer editing over closing.

  • 1. I don't need a predefined reason for everything, correct, but I have encountered this kind of questions several times before I went ahead and offered a custom close-reason. 2. As I explained in the comment to Travis J's answer, the question did not fall within neither "too broad" nor "primarily opinion based". 3. As for lack of explanation - this whole post is the very attempt to explain it better, and I think I did, in the final phrase. 4. The problem with it is not that it's asking for everybody's favorite way, but instead attempts to serve as a reference. – Eliran Malka Mar 19 '14 at 0:29
  • I agree that a good way to handle this kind of questions may be editing it, but how to edit in a way that would respect the post's content? (I wouldn't want to e.g. simply remove the line about "This question is meant as an open document to get inspired for cleaner code."...) – Eliran Malka Mar 19 '14 at 0:32
  • While I still see some issues with that type of questions, you've helped clear up a lot. Thank you. – Eliran Malka Mar 19 '14 at 0:34
  • @EliranMalka Attempting to serve as a reference is very good! It's only a problem if the reference would be too much for a Stack Exchange answer. Removing a phrase like “this question is meant as an open document” is perfectly acceptable and even encouraged: when there's a question which is partly suitable and partly not, it's a good thing to remove the unsuitable part. – Gilles 'SO- stop being evil' Mar 19 '14 at 0:41
  • Good point on removing the unsuitable part. However, if attempting to serve as a reference is good (note that reference has many, many meanings), why duplicate content which may be found elsewhere (In our case, probably in the AngularJS docs on the $compile service)? Maybe I'm just being picky, but as it's been claimed [citation needed] that the user's search chain for a solution should be: use the code/API official docs -> look up the official guides/wiki/forums -> google it -> stackoverflow it, it doesn't feel right to me to duplicate content which should reside elsewhere. – Eliran Malka Mar 19 '14 at 0:54
  • @EliranMalka The second step doesn't belong here, only organized documentation does. When it isn't in the official documentation, we hope that the step after “google it” will be “found on SE” — so if it isn't yet on SE, it should be asked, even if it's elsewhere! – Gilles 'SO- stop being evil' Mar 19 '14 at 1:12
  • That makes sense, come to think of it, I find myself referring to SO before going to forums/guides/wikis.... – Eliran Malka Mar 19 '14 at 1:35

In my opinion, no that should not be a reason.

Reasons are juggled all the time, but questions regarding coding standards and conventions tend to be opinion based. Each company or developer will have their own preferences of which way to go. I voted to close that question as opinion based because if I were to answer that question, it would basically be just an opinion.

enter image description here

  • I get it, and that was my first instinct as well, but the reason it didn't feel right is that I realized answers will not be opinion based -- they will just probably duplicate content that should reside on the library's wiki. Note the OP is not asking which is best, he/she is just looking to create an open document. – Eliran Malka Mar 19 '14 at 0:06

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