Software developers can’t write error messages
June 18, 2013
This is the sort of stuff that drives me nuts. Some guy (you know it was a guy) saved himself, oh, a minute or two by not writing an error message correctly, and that means that I (another guy) must spend many, many minutes in a debugging McGuffin to try to figure out what’s really going on.Here’s the message:
checking encoding (US-ASCII)... checking Python lib (/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7)... checking installed modules (/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial)... checking templates (/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mercurial/templates)... checking commit editor... Can't find editor 'runemacs' in PATH (specify a commit editor in your configuration file) checking username... 1 problems detected, please check your install!. Command line: hg -y debuginstall
Note that he’s really good at narrating success — here I am, I am checking this, here is what I saw, I looked here, I looked there. And then, uh-oh, “cannot find runemacs in PATH”.
Right at this instant it would be a REALLY good idea to print what he thinks the value of PATH is, because guess what, runemacs is a file, it is in my path, it is executable, etc. This is running inside another program (Eclipse), Eclipse may have gorked my PATH in some screwy way, I need details.
Said programmer then proceeds to indulge in misguided idle speculation (yet still manages to be uninformative) about how to fix this. I should “specify a commit editor in my configuration file”. If I were a Mercurial noob, this would tell me fucking nothing. There are various locations for my configuration file, and various ways to find it — but no guidance here ($HOME/.hgrc is the usual place for your commit editor to be found; it does not vary between projects. It would not be a risky stretch to say “, usually $HOME/.hgrc” and since he HAS access to $HOME, that could even be expanded on my behalf in the error message).
And how, exactly, might I “specify a commit editor”? That would be “editor=some-editor” in the “[ui]” section of the configuration file. That is:
Too much trouble to say that, I guess, it builds character in your users if they have to run around looking for information in poorly organized documentation.
And of course, rather than ever telling me what my PATH is (because no, that could never ever be wrong), it helpfully tells me a command to run to check my installation. Good try, but guess what, my mercurial installation is A-OK awesomely great, that command line just said so.
Myopic jerks. You could have saved a lot of time if you had just provided all the relevant information, instead of keeping it a secret.
Solution to problem is to specify the full path name to the editor, and quit relying on PATH being right: