5

I often see questions when somebody notices an as-yet-unknown feature or syntax in somebody else's code and posts a question about it.

Sometimes the author of such code really diminished its readability, and other times OP is simply ignorant of something that was relatively recently introduced. There are of course some clear RTFM cases.

When (if ever) are these "explain to me" questions on topic?

4
  • 1
    This is kind of similar to this What is the breakdown for Java's lambda syntax? for example and I wouldn't see that as off-topic. It all depends on how specific OP is in explaining what exactly is unclear.
    – Tom
    Feb 21 at 17:57
  • There's quite a few related questions already meta.stackoverflow.com/questions/linked/271468?lq=1 Could you review them and if none are duplicates, could you edit your question to more specifically describe what kinds of questions you're referring to?
    – cigien
    Feb 21 at 17:58
  • 5
    Such questions must be focused. OK: *What does this line do?" (referring to a symbol or an object or method - though it'll often be a duplicate) Not OK: "What does this block of 20+ lines of code do?" (without a qualifier on what exactly the user is having trouble understanding) Feb 21 at 18:05
  • 1
    As (what I think) is a great example of such a question would be something like What is the meaning of the prefix N in T-SQL statements and when should I use it?. Finding what the N means in the documentation is not as simple as you'd like (it just took me about 6 different searches and none used "N character" in the search string).
    – Thom A
    Feb 21 at 18:40

2 Answers 2

14

Yes, they are almost always on-topic.

But often, these types of questions have other issues. Asking "Can someone help me understand what this code is doing?" is not an answerable question. It's way too broad and unclear what the OP is actually asking about. If you know what they are asking about, you can edit the question. In all other cases, you should be voting as unclear or unfocused.

Questions asking what a particular syntax does or how it works are a great addition to our knowledge base, provided that they are reasonably scoped and others can find them in the future. They can offer information, explanation, or examples unavailable in the official documentation.

7

Such questions are often on-topic (it is really hard to ask a non-programming question about code/language syntax) and when scoped properly often are good enough to deserve a spot on the site (either as standalone posts or search-friendly duplicates) .

While often the real answer is RTFM, it is frequently hard to actually identify the place in the FM to read about the feature. For example I can't think of any language specification that has cross-reference for "usage of ?" or "usage of !" which are very common for C# (and similar curly-brace languages) - as result having such question on SO give a good chance to point to the right place in the spec using terms that are searchable.

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