7

Please see my exchange of comments with @Bruno Lowagie on this question.

Bruno as provided some source code as an answer. While I, as a fellow programmer, might welcome such an answer, I think I would probably be asking my question on S.O or programmers.

  • Is source code acceptable as an answer?
  • Does it matter whether OP has stated whether they are a coder or welcome code?
  • Do we need a new tag for source-code-welcome?

I am not trying to start a flame war here; I am truly curious.

2 Answers 2

8

We've had a somewhat similar question in the past: Are answers which provide a complete script acceptable?

As I write, the top two answers are:

[+5] I would say that we probably shouldn't be giving people large blocks of code in the answer

[+5] I think it is perfectly acceptable.

Sorry, no general consensus here.

In the specific case of https://softwarerecs.stackexchange.com/a/18681, the answer is not a complete solution. It's some Java source code, whereas the question asked for a program. If the answer included instructions on how to compile and execute this program on the asker's platform, and a way to randomly display one of the resulting pages, it would be a complete solution.

5
  • I don't see it as any more an incomplete solution than a recommended binary with an installer package. It takes a bunch of steps to download an installer, install it with options, fire up the app, make it do something random, just like a source code chunk. We don't require SR answers to provide that for binaries; why require it for source code?
    – Ira Baxter
    Commented May 25, 2015 at 7:22
  • @IraBaxter Because J Random User knows how to download an installer and execute it, but wouldn't know what to do with source code. If the question was a request for a library in language X, you could safely assume that the audience knows what to do with source code in language X, but not when it's a request for end-user software. Commented May 25, 2015 at 11:40
  • If your objection is "the steps to execute the source code may not be obvious", I sort of agree, but a motivated asker is presumably willing to work that out and the web is full of help. Your response also included the requirement to run the program to get an answer ("a way to randomly display one of the resulting pages"); I don't see that as different for source vs. binary, nor do I see it as necessary.
    – Ira Baxter
    Commented May 25, 2015 at 12:45
  • Others think doing this with scripts is just fine: meta.softwarerecs.stackexchange.com/a/133/101 I sort of hesitate when it comes to "pull from github, figure out how install the build environment, then how to run the build scripts, do the build, and voila, you have the software" but realize that's just an extreme version of my position. If there are other answers which are simpler to fetch/run, presumably they'll show up. If not and the code/script/github reference produces a viable solution... well, why not?
    – Ira Baxter
    Commented May 28, 2015 at 6:24
  • @IraBaxter Quoting Undo: “Just write software, not code”. Showing some source code and not explaining how to use it is radically different from providing some software which an average user would be able to install. Commented May 28, 2015 at 6:52
5

In my answer, I referred to iText, which is a PDF library. See also Free or nearly free PDF library for Java Due to the very specific requirements of the OP, I don't think that there's a solution that works "out-of-the-box", so along with the recommended library, I also provided some source code and links to StackOverflow.

Mawg states that the OP might not be a programmer, implying that my answer isn't useful for the OP. I don't know. Maybe the OP is a developer, maybe he isn't. However: there is at least one developer Mawg who has read my answer and that could bring the OP closer to a solution.

My answer could inspire a developer to build a small ready-made tool that fully meets the OP's requirement, should the OP for any reason not be able to use my answer. For instance: because he doesn't understand Java or C# code, or doesn't know how to use a software library.

If you ban code, then what is the point of software recommendations? Without source code, there wouldn't be any software, would there?

5
  • Bruno, I don't Claim" that the OP isn't a programmer. I can't know that. He might be a pilot, but he does say "for example". Yes, your answer might inspire someone else develop a custom solution for the OP and post a link to it. That is a very good point, I wonder what others think. I don't think that your last paragraph holds any water, though ,-) I realize that you are trying to help and praise that. In fact, if your answer inspires you to make a custom app for the OP then you can be sure that I will upvote it :-)
    – Mawg
    Commented May 13, 2015 at 15:20
  • OK, I changed it into "Mawg states that the OP might not be a programmer". Developers are undervalued. Software is being taken for granted. Just like kids no longer know that milk comes from cows, people tend to forget that developers (and code) are needed to make software. Let's show them code, so that they don't forget ;-) Commented May 13, 2015 at 15:44
  • 2
    Well, this is about educating the people rather than answering the question. I think we're not here for that. If you want to code an answer and give both code+solution, then I'm happy with this. Anyother code answer is just plain, useless show-off to me.
    – VicAche
    Commented May 18, 2015 at 15:45
  • I'm not opposed to having source code in an answer, but it's only good if the asker will know what to do with it. If you included instructions to download a Java compiler and compile your program, then your answer would be useful. As it stands, it isn't useful, because most people who want to split PDF files have no idea what to do with Java source code. The question in question is not asking how to write a program to split PDF files, it's asking how to split PDF files. Commented May 25, 2015 at 11:43
  • @Gilles: that would make this "software executables recommendations". What if it comes with an installer? What gaurantee is there that the asker knows how to run it? It seems to me this question revolves around "how much are we willing assume of the asker"? It seems to me that the asker can fix this by providing a requirement: "It only takes this knowledge to run it...."
    – Ira Baxter
    Commented May 28, 2015 at 6:32

You must log in to answer this question.

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