Why? I don't even understand the lock.
I didn't get trolled into posting an answer. My answer was a serious post addressing a serious concern I had for the user's code. Importantly, I think the advice in my answer at least is applicable far beyond this post in itself. It's actually not all that common that Code Review answers can be applied outside of the specific question they answer.
My answer is full of helpful take aways:
In general, comments are good. They help any future maintainer (including yourself when it's been 6 months since the last time you looked at the script) to understand what the code does because programmer time is extraordinarily valuable. Programmer time should be spent fixing the code--not trying to understand it, and helpful comments go a long way toward cutting down on the "trying to understand it" part of the program.
As a note from someone who has plenty of experience dealing with users, your best bet is to program for the lowest common denominator. A "stupid" user is still a user, and if you're not capable of writing programs that "stupid" users can use, then perhaps it is you who has no hope as a programmer.
I'd also argue that including some instructions on how to install the missing library would probably be helpful in your echo
statements.
Importantly, I still can't see any reason why the post even should be deleted. It's not even an off-topic post.
On what grounds is the post off-topic? Why is it even locked?
The only reason I can see for it being locked is that perhaps the comments got unwieldy? But surely those have died down at this point.
Even the downvotes on the question are unfair. People who would normally upvote a question of this quality are downvoting this one.
And let me clarify that...
- The code works.
- The asker is clearly seeking a review.
I don't remember why I originally downvoted it, but if I downvoted it today, it'd be because the plain-English part of the question does almost nothing for the question. It doesn't explain what the code does, nor does it point to any specific areas of concern. Neither of these things seem to be required for the question to be on-topic, but I tend to downvote questions with these problems.
Others, on Code Review, however, don't downvote for the reasons. And if the comments in the code didn't have such an attitude, this question would probably have a pile of upvotes.
This question should definitely not be deleted. There's nothing wrong with the question (or if there is a problem with the question, I have a pile of other questions that generated far less traffic and interest in the site that we can delete too).
This question probably shouldn't even be locked. I've never bothered mentioning it should be unlocked before because personally, I have nothing more to say about the code. The OP hasn't come to ask it to be unlocked, so perhaps he's not interested in further review. And arguably, unlocking it may just lead to a headache of comments that need to regularly be cleaned up.
But if we replaced the code in the question with any other code, this question would have at least 5 upvotes, and we wouldn't be having this discussion. So given the fact that the code in the question works, why are we even having this discussion? I don't get it.