4

What is the proper course of action for questions asking for an example code or algorithm? I've come across a few of those in recent weeks, i.e., this one:

https://stackoverflow.com/questions/20025536/what-are-some-reasonably-simple-single-file-c-programs-that-are-allocation-point

What are some reasonably simple single file C programs that are allocation/pointer intensive and do something interesting eg: implement an algorithm or perhaps do something mathematical?

I've marked it to be closed as "asking for library, tool or offsite resource" but now I realize it is not that at all.

This question can be answered and one could find it pretty useful. I.e., answer can mention some classic algorithm and explain how pointers are used there.

I'd think of considering it "too broad"

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.

but answers could be quite compact, and well, in theory any question can possibly have an infinite amount of answers. "too many possible answers" is quite subjective as well - I don't think people can come up with more than 20 different simple but demonstrative programs. What if I edit question to "less than 100 lines" instead of "simple" - it surely will cut it down? There are lots of questions where people ask for one-liners in python and get quite a few different answers, but those are not closed as too broad.

So, I realized I don't really know what is the proper way to deal with such questions. It feels to me the border is very slim and since lack of research alone is not really a closing reason, should such questions be closed or edited or what else? Honestly, now I think I could have upvoted it if it would be formulated in just a bit more shaped up way.

1 Answer 1

4

Here's the relevant part of the "too broad" close reason:

There are either too many possible answers...

Asking for an example of something allows for an infinite number of answers since anyone can post anything so long as it demonstrates what the question was talking about.

17
  • Would this apply to a question such stackoverflow.com/questions/1201593/… too? Commented Nov 17, 2013 at 0:35
  • (cc @GabrielePetronella) Someone historical-lock that! Commented Nov 17, 2013 at 0:38
  • @Gabrielle That looks very much like a "What is the difference between C and C++" question to me.
    – animuson StaffMod
    Commented Nov 17, 2013 at 0:40
  • @animuson, not quite, that would be much broader. Answering: "C++ has classes" wouldn't be appropriate, for instance. Commented Nov 17, 2013 at 0:44
  • 1
    By the way that question is extremely interesting and useful, in my opinion. Could you consider to historical-lock it, apart from closing it? Commented Nov 17, 2013 at 0:45
  • 1
    @animuson That question actually asks "What can C do which C++ can't" which is kind of different.
    – sashkello
    Commented Nov 17, 2013 at 0:48
  • 1
    And by the way, the possible answers to this particular question are definitely not infinite and I don't think this is too broad at all. I don't think it should be closed.
    – sashkello
    Commented Nov 17, 2013 at 0:54
  • @sashkello Well the criteria for closure is not infinite, it's too many (or possibly too long for those that incorporate all the answers into one). That question is definitely too broad.
    – animuson StaffMod
    Commented Nov 17, 2013 at 1:02
  • 1
    @animuson well actually it can be fully answered by enumerating a finite list of cases, which is shorter than many valid answers out there on SO, as the first answer demonstrates. Commented Nov 17, 2013 at 1:04
  • @Gabrielle That's not a complete list though.
    – animuson StaffMod
    Commented Nov 17, 2013 at 1:06
  • Then go ahead and add the missing cases :) Commented Nov 17, 2013 at 1:07
  • @Gabrielle I refer you to this answer which links to a book-length webpage.
    – animuson StaffMod
    Commented Nov 17, 2013 at 1:08
  • 1
    @animuson you have a point. Can I still suggest an historical lock? I think it wouldn't do any good to see that answer deleted one day Commented Nov 17, 2013 at 1:10
  • 1
    @animuson An answer can always outline the important points and link to some resources which have more comprehensive information (which, as I understand is encouraged). It doesn't require link-only answer. Answer can always summarize things and provide an additional link.
    – sashkello
    Commented Nov 17, 2013 at 1:24
  • 1
    There are either too many possible answers is no longer part of the current too broad guidance. Is this answer still what should happen, or has the stance changed in years since this answer? Commented Aug 13, 2019 at 12:55

You must log in to answer this question.

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