20Software Ethics

Ethics is knowing the difference between what you have a right to do and what is right to do.

—Potter Stewart

It should be noted that no ethically trained software engineer would ever consent to write a DestroyBaghdad procedure. Basic professional ethics would instead require him to write a DestroyCity procedure, to which Baghdad could be given as a parameter.

—Nathaniel S. Borenstein

What You Will Learn in This Chapter:

  • Ethical behavior
  • Software engineering dilemmas
  • Thought experiments

Before this chapter really begins, we need to agree on some simple definitions. If you ask most people about ethics and morality, they'll probably mumble something about whether an action is right or wrong. Some say that ethics is a standard defined by society or community, while morality is defined more personally even if a principle is not covered by societal ethics. Ethics: Is it okay to park in a handicapped spot? Morality: Is it okay to commit adultery?

Unfortunately, some people swap the definitions or use the two terms interchangeably. In this chapter, I'm going to talk about ethics, and by that I mean the first definition: what society thinks is right.

With those two definitions for ethics and morality out of the way, we can ask, “Why should you study software ethics?” The answer is, “So you can recognize ethical questions when they arise and have a framework for understanding how to handle them.” Just as firefighters, soldiers, and emergency room doctors train ...

Get Beginning Software Engineering, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.