Is computer science a "science" in the same way as the natural sciences? Sometimes I think it more closely resembles math, in that the kind of reasoning it is engaged in is in some sense a priori.

Parts of computer science are like other sciences, parts are certainly like mathematics, and parts are also like engineering. Some people have argued that it is a natural science, others that it is an "artificial" science, still others that it is not a science but a branch of engineering, and so on. The answer to your question of whether computer science is a science depends, of course, on what is meant by "science" as well as what is meant by "computer science". What some people call "computer science" others call " computing science", "computer engineering ", "informatics", etc., each seeming to emphasize a different aspect of the discipline. And the question of what constitutes science (as opposed to, say, arts or humanities, on the one hand; "pseudoscience", on the other hand; and mathematics, on another hand) is a major topic in the philosophy of science. For some readings, by computer scientists as well as philosophers, on this question, take a look at some webpages I created on...

I'm a scientist. The results of my research may generate technologies that could potentially be used in both and offensive and defensive military applications. These same technologies could potentially help people as well. Here are two examples: (1) My work could potentially create odor-sensing devices to target "enemies" and blow them up, but the same work could aid land-mine detection and removal. (2) My work could help build warrior robots, but it could also help build better prosthetics for amputees. For any given project, I have to decide which agency(ies) my lab will take money from. I do not want to decide based on the name of the agency alone: DARPA has funded projects that helped amputees and killed no one, while I would bet (but do not know for sure) that some work sponsored by the NSF has ultimately been used in military operations. So I'd like to base my decision on something more than the agency acronym. How can I start to get my head around this? What sorts of questions should I...

I am happy to read Miriam's and Thomas's replies to this question, because it is one that I somewhat unexpectedly faced when I switched from being a professional philosopher to being a professional computer scientist (albeit one with a highly philosophical bent!). The first time the issue came to light was when I gave a talk to computer and cognitive scientists at the University of Texas at Austin about 20 years ago. One of my hosts was Benjamin Kuipers , a leading researcher in artificial intelligence, who had done groundbreaking work, as a grad student supported by military funding, on "way finding": How to program computers to give and to follow geographic directions. He told me that after he got his Ph.D., he realized that, as a practicing Quaker, he could not in good conscience continue to take military funding, especially if that meant that he would have to fire grad students or postdocs who would be working under his direction if the military asked him to do something against his beliefs...

I would appreciate some recommendations on texts (for a layperson -- a nonprofessional philosopher) whose subject is the philosophy of science.

And I'll chime in with my favorite: Okasha, Samir (2002), Philosophy of Science: A Very Short Introduction (Oxford University Press), which I think is a terrific survey and lives up to its title of being "very short". I'd also agree that it's probably best to look at a survey such as the Stanford Encyclopedia of Philosophy article, or something like Okasha's book, before diving into one of the classics.