Date: 09 Nov 1995 02:57:30 GMT From: firstname.lastname@example.org (Mark-Jason Dominus) Subject: Re: system() question In-reply-to: email@example.com's message of 6 Nov 1995 20:57:41 GMT Newsgroups: comp.lang.perl,comp.lang.perl.misc Keywords: deficient infernal intention saltwater X-Project: Carpere diem
In article <firstname.lastname@example.org> email@example.com (Robert Paul Braddock) writes:
> Annoying, isn't it? I never get answers to questions in newsgroups.
There are a lot of reasons, many of which get repeated over and over again, many of which don't. Some of the reasons you hear a lot are: Questions are incoherently phrased. Questions have the form `my code doesn't work' and don't include the code. Questions include the code, and it's 200 lines long, and comp.lang.perl is not a debugging service. Nobody knows the answer to the question. The question is so badly punctuated that nobody can bear to read it. Questions are written by a non-native speaker of English and the native speakers who are trying to understand it can't. (That's a shame, but it does happen. I often wish that these people would post in their native languages. I'd love to see more discussion in languages other than English. Some Dutch guy tried posting all his comp.lang.c articles in Dutch a few years ago, and all the Americans flamed him. Sometimes it can be awfully embarrassing to be an American!)
Apart from these oft-mentioned reasons are many others that are not so often discussed, because anyone who tries to bring them up gets flamed. But it's the truth: I know the reason I don't answer more questions is because so many of them questions are so damn stupid. They're stupid in a lot of different ways, but they're still stupid. I don't want to suggest that that's why your questions go unanswered. I don't know what you're asking. Perhaps the reason your questions go unanswered is because they're so deep and interesting that nobody really knows the answer. But I want to talk about stupid questions.The most common stupid question is the one from someone who has some high-level problem that they need solved. They have an idea that they'd like to do it in Perl, and they don't really know Perl. So instead of learning Perl, they post to comp.lang.perl.misc.
Now don't get me wrong. I don't have any problems answering the questions of someone who's trying to learn perl. I love THOSE questions. But these people don't seem to be asking useful questions for that.
Today, for example, I saw a question from a guy who wants to get a list of hostnames out of nslookup. `How do I do that?' he says. And it's hard to know what to make of that. What does he mean? Does he not know how to open a pipe? Is his `open' command failing? What's going on here? I can't give a useful answer without understanding the problem. Having your `open' fail is a problem. Wanting to list hostnames is not a problem; it's a desire.
Here are some similar questions that would have made more sense to me:
``I'm a lazy asshole and I can't be bothered to learn to program myself, but I know if I post here you'll give me something for free.''
(OK, fair enough. At least I can send him a rate card.)
``I'm trying to use `open' to talk to nslookup, but... ...here's my code; what's wrong?''
``I know perl has a `system' command for running programs, but I can't see how to get my commands into nslookup once I have run it.''
``I'm trying to use `getprotobynumber' to talk to nslookup...''
See, I'm not just biting people's heads off, here. #4 is a good question, because it gives me something to work with. OK, he has a very weird idea about interprocess communication, but that's ignorance, and that's what we're here to correct. He doesn't know about `open'; I can refer him to the manual.
Here's another example: Some guy wants to assemble a list of email addresses . ``How do I do that?'' he wants to know. Well, duh. Get a big pad of paper and read news for a couple days and write down all the addresses you see. Problem solved. What's it doing in comp.lang.perl?
Oh, you wanted to do it in perl. Well, I guess I'd open a socket to the NNTP server and send it some XHDR commands for the `From' lines. But that's not Perl; you could do that in any language. I could do it in Bourne Shell for you if I'm allowed to use a little external thingie to handle the socket parts for me. What's it doing in comp.lang.perl?
Oh, you wanted us to write the program for you? Wait, let me send you my rate card.
Someone posted yesterday asking how to get the data from a file where the start and end of the data is marked by keywords. Same thing going on here. ``Well, here's how you solve your problem: First you go take an introductory class in programming and learn to write programs in some language. Then you go to the bookstore and buy this book by Wall and Schwartz, it's really good. Read the book carefully and try out the examples. Then if you still have general questions like `How do I do this' instead of `I thought that this code would do X but instead it does Y' You hire a professional to write your program for you. Or you could just skip right to step 3. Want my rate card?''
The worst stupid questions are the ones that come from people who have no business asking them. The most perfect example of this that I could have imagined was in comp.unix.questions a couple of years ago. Some guy came and asked how you could tell if a file is a hard link. My jaw flapped open and it's stayed open since then. I couldn't have been any more stumped if he'd asked why Bodhidharma came from the West. What do you say to this guy? Do you tell him the truth, that all files are hard links, that even symbolic links are hard links? He's not going to understand you; you might as well keep your mouth shut. Do you tell him the truth, that the answer won't do him any good because he doesn't know what a hard link is, so why did he bother asking in the first place? No, that'll just make him mad. I followed that message for the next couple weeks, and nobody said anything. What could you say? The guy had no business asking the question and no use for the answer. Maybe the right answer would have been to cut off his finger or something. I dunno.
Some questions get ignored because they're boring. Someone asked today how to compare two variables (I assume he means the contents of those variables) to see if they're exactly the same. You've gotta be in an awfully good mood to take the time to answer that. Maybe someone will. Maybe I will.
But if I answer that one today, maybe he'll be back tomorrow asking how to check to see if two variables contain different values---so maybe I better not answer it. What I find incredible is that if you tell these people to go read the manual and come back in two weeks, you sometimes get jumped on for not being helpful to beginners. Bah. If everyone told these people to go read the manual, they might eventually figure out that that's what you have to do, and then I wouldn't have to spend so much of my life dealing with incompetent programmers.
Some questions are logically nonsensical because the querent thinks they know more than they do. A lot of these have the form ``How do I use X to accomplish Y?'' There's nothing wrong with this, except that sometimes X is a chocolate-covered banana and Y is the integration of European currency systems. I always get stuck on these, probably because I can't get rid of the idea that the person really has a good reason for wanting to use X. I know a half-dozen easy simple ways to accomplish Y, but I can't imagine what X has to do with it. This is a problem for me in my day job, too. Clients are always saying to me ``We want to use product X to do multimedia development on the world-wide web,'' and all I can think is ``Well, gee, what would you want to go and do that for?'' Sometimes it turns out that they want to do it because they want to impress the manufacturers of X, and I don't work on those jobs.
The flip side of this is a question like ``I want to accomplish X, but I don't want to use Y. What can I use instead?'' Which, again, is sometimes reasonable, and then sometimes X is closing a filehandle and Y is the `close' function.
The questions I like the best are the ones that go like this:
``I want to accomplish X.
I thought that the following code fragment would do it:
But instead it does Y.
Why is that?''
This one is also pretty good:
``I want to accomplish X.
I thought I might be able to use facility Y.
But Y doesn't seem like it's quite right, because of Z.
What should I use instead of Y, or how can I overcome Z?''
When I ignore these, it's usually because I don't know the answer. There were an awful lot of them today. It makes me very happy.
There you go; a 160-line dissertation on why questions go unanswered. Now don't let me hear you saying nobody ever answers your questions.
A clarification about ``How can I tell if a file is a hard link?''
More about `How do I use X to accomplish Y?'
The Cardinal Rule of Reporting Technical Problems
Return to: Universe of Discourse main page | What's new page | Perl Paraphernalia