Would you write a recommendation for a student you don’t know well and/or who performed poorly in your class? Most people would say no.
Conventional wisdom is that most useful references (for just about any job) come from someone who (a) knows the candidate well, (b) can evaluate how the candidate compares to his or her peers, and (c) supports any claims (“great writer,” “careful thinker,” etc.) with specific examples based on first-hand knowledge. Other chestnuts include that one should decline to serve as a reference unless one has something positive to say about a candidate, and, if declining, say something vague like, “I’m probably not the best person to write a recommendation for you.” I generally agree with all of these statements. They amount, in my mind, to a loose set of “best practices” for faculty members who are asked on a regular basis to recommend students for jobs, clerkships, fellowships and the like.
Faculty members who teach big classes inevitably will be asked for a recommendation by a student who is a (relative) stranger or a poor performer. Can the professor ethically agree to serve as a recommender? Should the professor? I think that the answer to both questions is yes, if the faculty member is willing to dig a little deeper with the student, and the student is willing to put in the time.
I admit that sometimes I’d rather say no to a recommendation request than to have a 30 minute meeting with a student who never made an effort to talk to me (and vice versa) until that moment. It is tempting to cut corners. But I try to remember that most students don’t ask for references from a faculty member in whose classes they’ve performed poorly. Nor do most students ask for references from a faculty member they’ve never spoken to outside of class before then. The student wishes he or she had other options, too. Writing recommendations -- for these students, too -- is part of my job, after all.