Advice to Students Asking for Recommendation LettersEvery year I get a number of requests from students that ask me for recommendation letters. This page is a summary of my advice to you, based on my experience as someone who has written letters for students over the years as well as read a large number of letters from prospective graduate students applying to Ph.D. programs. (Disclaimer: this applies to those interested in a top-tier research-oriented school.)
The first thing you should realize is that if the only thing I know about you is your performance in my class, my letter is likely going to look like the following:
"I know X because s/he took my class Y. X's performance in the class was [insert words here], and his/her rank was Z. Overall, I believe X will do [insert words here] in a graduate program. I [insert words here] recommend him/her to you."This sort of letter is useless, and does not count for anything. Everything I've said in the letter can be found (more or less) in your transcript. Also note that giving me a copy of your statement of purpose will not change this letter in any way. Even if you have done an outstanding project in another class or a project with another professor, I will not comment on it unless I have some personal knowledge about it. Any information of this sort will be in your statement, and so I am not going to repeat it.
If you have taken my class but you stood out in some way that is not clear from your grade, then I can explain that in the letter. This is not easy if the class is large, but it has happened on a couple of occasions (couple = less than 1% of students I've taught). If the class you took was small and/or had a final project that was open-ended, that would be something I could comment on as well.
A strong letter is one where I can say specific things about your research potential. An example of such a letter is:
I know X because s/he took my class Y. X received a B in my course, and was ranked 24th out of 90 students. Toward the end of the semester, I was approached by X who expressed interest in writing tools to validate asynchronous pipelines based on his/her frustrations with the lack of design automation. X had many ideas about the subject, and after an initial discussion with me came back a month later with a prototype checker that could validate basic properties of simple pipeline structures. Since then, s/he has come up with many new ideas for algorithms based on classifying pipeline structures into different categories. The basic prototype checker has been expanded to include a theorem prover that can provide sophisticated checking for conditions when simple analysis fails. We are in the process of preparing a paper on the subject that will be submitted to Z. I think X is an outstanding candidate for any graduate program. I would admit him/her to my group without hesitation. I give X my highest recommendation.This letter is strong because it contains information about the student's creativity, research potential, independence, initiative, and drive. It also says I was sufficiently impressed to take on the student even though the student did not do that well in my class.
Ideally, all your letters would read like this one. To have a good chance of admission to a top-tier Ph.D. program, you should have at least one letter of this type.
Doing a project with me but not doing a good job is probably worse than my not knowing anything about you. Even if you couldn't do a good job because you were too busy taking classes, it shows that research was not a priority for you.
After I finished writing this page, I found the document "Applying to Ph.D. Programs in Computer Science" written by Mor Harchol-Balter. Her views are very similar in spirit to mine, and reading her document would be very instructive.