Yeah... not so useful
Posted: Thu, 4 August 2011 | permalink | No comments
This started out as an attempted comment on the original blog post in which I read about this, but the comments system over there doesn’t work without Javascript and Cookies, so fuck that – I’ve got a blog of my own that doesn’t require me to bend over to say something. This is a rant, by the way; I have no particular interest in making this idea better, so don’t expect answers, just expletives.
The nubby admin, in trying to drum up support for a git repo full of undocumented scripts, writes:
How many of us have toiled away on a home-brewed script to solve some seemingly esoteric problem? Or perhaps it’s a completely mundane and repetitive task that we’re automating. After pounding out line after line you are left with one of two thoughts (or both, as is my case):
- Surely someone has had this problem and scripted the solution before me! I wish I had their script.
- Surely someone after me will wish they had the script that I’ve just now created. I wish I could distribute it easily.
The third thought in this sequence, though, is “what brain-damaged protohuman banged on the keyboard with their crude club to produce this heap of crap?”. You then go and write something yourself in less time than it would have taken to work out what the hell the existing script does.
That’s not even the worst case, though: I’m assuming here that the script
isn’t chock full of local assumptions that make it impossible to use in your
environment, and isn’t going to do something deadly to your systems. Shell
scripts with insufficient quoting in the face of esoteric characters – like
spaces – is just one delightful example. My personal favourite is the
script that did rm -rf /${ARG}
without first checking that ! -z
"${ARG}"
– yes, there are people that stupid; yes, they do get paid to be
sysadmins; and yes, they’re at least as likely to be writing
publically-available scripts as anyone with two or more available
braincells. Scared yet?
Producing something useful to a general audience is at least an order of magnitude harder than producing something that you can use yourself (or as part of a small team). Just dumping whatever falls out of your fingers onto Github isn’t going to help anyone. At the very least, you need to:
- Clean up the code to make it generally safe (and not completely embarrassing to have associated with your name);
- Probably add command line arguments and options so you don’t have to edit the script every time you want to do something slightly different;
- Write some documentation so people know what a script is and what it does (and if you’re feeling really helpful, what it doesn’t do);
- Test it fairly thoroughly to ensure that you’re not about to unleash a monster on the world.
All this work takes time. My recent release of
Giddyup
is a case in point: hacking together the script to make it do what I needed
it to do took me a total of around two hours (this is including the time
spent making the several variants of it that were used for different
projects). The time involved in making it fit for release was measured in
days – and this is for a 40 line script that isn’t a whole lot more than
a git archive
. Complicated stuff takes a lot more time to get ready.
I don’t buy the argument that you can dump your crap into a Git repo and others will “pitch in to make them better”. This is the worst possible interpretation of the Bazaar-style development model, and in reality it just doesn’t work like this.
A shoddy script gets ignored, in favour of yet another reimplementation – usually in a different language, just to add to the fun. Before you know it there’s 18 scripts that all do roughly (but not exactly) the same thing. All of them only cover a part of the entire problem space, none of them are documented, and nobody’s really curating this mess so there’s no guidance as to which one is “the best” (or even the circumstances in which you might want to use one over the other)… it’s a clusterfuck.
Examples of this sort of thing abound. Publically-available Puppet modules spring immediately to mind, mostly because they’re a particularly egregious example of the stupid leading the stupid, but Nagios Exchange is always good for a hollow, bitter laugh at the collective stupidity of the Internet.
I’m curious, though, about the rationale behind the workings of this particular collection of cruft. If everyone’s got to have a Github account to contribute, why wouldn’t they just put their own tool(s) up in their own repos? That’d even save the hassle of having to put all their stuff under the Apache licence. It’s not as though public Github repos are expensive. The thinking might be that it’s not as easy to find random scattered repos, but you’re not going to have a fun time digging through a million undocumented scripts in one big repo, either, and I’d say Google will do an adequate job of indexing individual repos with good metadata that contain useful content.
For that matter, how many potential contributors are going to own the copyright on their scripts? Not many, and even enlightened employers have a limit to how much secret sauce they’re willing to give away (and how much time employees can waste cleaning up the proprietary information – like hard-coded passwords – out of scripts so they can be released into the wild).
Post a comment
All comments are held for moderation; markdown formatting accepted.