12

Olli has this excellent question which asks for a file integrity checker. I'm sure many of us could write up a quick shell script and cron entry that will do exactly what he needs.

We seem to have established that offering to write code for an asker is bad mojo. But what if, instead of an offer to write it, we just provide the complete code right there in the answer?

Would this be considered any different from linking to your own open-source project on Github? And in that line of thought, would it be better to just write the code, publish it github, and link to it in the answer?

2
  • I think offering to write code, or providing already-done code are completely different things. Offering to write code is quite iffy - will it ever get done, is some compensation required?
    – Olli
    Commented Feb 13, 2014 at 10:29
  • 1
    And as of linking to your own project, disclosing that you're the guy who did it is usually a requirement.
    – Olli
    Commented Feb 13, 2014 at 10:31

3 Answers 3

11

I think it is perfectly acceptable.

If I ask for something and get code that works, then I am really glad I got this answer.

Of course, a Github project is even nicer, but it should not be a requirement. Some people might not even have a Github account. If the answer is good enough, someone will gitify it sooner or later.

Especially in the case of programmers asking for libraries, answers that require programming/compiling skills are perfectly OK.

It is also OK to post an answer saying "I took busy_genius' source code answer, wrapped it into an easy-to-use package, and uploaded it at this URL". If it works well and the uploader does a good job maintaining it, then their answer will climb to the top over time. Everyone wins.

8

I would say that we probably shouldn't be giving people large blocks of code in the answer (a simple cron job to run another program is probably okay)

In regard to throwing it out on GitHub, I say that's a great idea - but we need to remember our audience: they're not programmers. They're users. If we're pointing them to something on GitHub, it had better be extremely simple to install, preferably already built, and very easy to configure. Users shouldn't have to apt-get install a bunch of stuff or play with Ruby gems.

Basically: if you want to write something to meet someone's needs, go for it. Just write software, not code.

4
  • The question I linked would definitely be a very short shell script.
    – dotVezz
    Commented Feb 5, 2014 at 15:56
  • 3
    After thinking a little, I've come to the conclusion that an answer like “use bash with the following script” is a perfectly reasonable form of answer — you're specifying a tool or tool collection (bash and other scripting utilities) and a method of using them. It may or may not be suited to the task — recommending a command line answer to someone who clearly wouldn't know how to use it is bad — but it's acceptable in principle. @dotVezz In this case, writing a sufficiently robust script is actually fairly hard. Commented Feb 13, 2014 at 6:36
  • @Undo, Is a dll file not considered software? If we have a question Q: "What plugin for X can I use to do Y?". Is this a good answer: A: "Here's some code, save it as a .plugin file and place it into folder Z and relaunch your app"? Or how about this: A2: "Here's some code, press Ctrl-Q to open the plugin player and paste it in"?
    – Pacerier
    Commented May 21, 2015 at 8:31
  • I would say that it's acceptable, @Pacerier. We have an ongoing discussion about source code answers - you might want to weigh in there :)
    – user46
    Commented May 21, 2015 at 13:01
4

I think there are 2 ways in which producing code is acceptable:

Short Scripts, phased as a recommendation for the script-interpreter: Eg:

I recommend scripting with Bash Shell, and the cron tool. An example of how to script this is below. Example example example

Advantages: - Highly configurable -... Disadvantages: - Not layman friendly - ...

Or if longer, Release it as open source on some other site Eg

AUPS (A Unique Programmed Solution), is a tool I made for this purpose. It is available from my GitHub...

It is important the we Recommend Software not Write Code Solutions.

0

You must log in to answer this question.

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