Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Software that we write has ramifications in the real world. If not, it wouldn't be very useful. Thus, it has the potential to sweep across the world faster than a deadly manmade virus or to affect society every bit as much as genetic manipulation. Maybe we can't see how right now, but in the future our code will have ever-greater potential for harm or good. Of course, there's the issue of hacking. That's clearly a crime. Or is it that clear? Isn't hacking acceptable for our government in the event of national security? What about for other governments? Cases of life-and-death emergency? Tracking down deadbeat parents? Screening the genetic profile of job candidates?

Where is the line drawn? Who decides?

Do programmers have responsibility for how their code is used? What if a programmer writes code to pry into confidential information or copy-protected material? Does he bear responsibility along with the person who used the program? What about a programmer who knowingly or unknowingly writes code to "fix the books?" Should he be liable?

share|improve this question

closed as primarily opinion-based by gnat, MetaFight, MichaelT, Bart van Ingen Schenau, GlenH7 Jan 24 '15 at 18:10

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

I really like the words hack and hacker in their non-criminal uses; preserving that is a losing battle it seems. For some ethical guidelines see the ACM code of ethics: – kasterma Dec 31 '10 at 17:15
up vote 10 down vote accepted

As we are discussing ethics, there is a split to be made between legality and straight morality, the two do not necessarily sit on the same page.

Legally speaking, your culpability for the result of what you create varies by region, but most fault lies with the user. If the product is intrinsically illegal then the programmer may be culpable. In the US for instance, development of encryption circumvention software is illegal in and of itself.

Morality has far greater scope. Whether or not what you develop should be developed is a matter for the conscience of the individual. Some people are happy to say to themselves, "if I did not make this, someone else would", or "the use of this is nothing to do with me" - well, if a person can do that and sleep, then that's that. If not, then they should not. Companies can and often will fire an employee if they refuse to do assigned tasks, if the task is not illegal in itself then the employee really does not have a leg to stand on, unless it could count as a discrimination issue in jurisdictions that support it.

Personally, I think morality is critically important and have actively refused tasks from directors where I think they are morally wrong, though that does mean betting your employment against their wider need for you and causes trouble in any event.

Always try to remember, that without your own self respect, you have nothing at all.

share|improve this answer
+1 for the split between legality and morality. – Michelle Tilley Feb 9 '11 at 2:40
@BinaryMuse: It alarms me how regularly people believe them to be one and the same. Granted, that would be an ideal state of affairs, but the law is rarely ideal. – Orbling Feb 9 '11 at 2:45

In the early 2000s, I worked for a company that had contracts to produce weapons components for the Israeli military (can't go into more distinct details than that without giving away too many clues as to who the company was).

Anyway, that was my first taste of serious ethical questions as a programmer:

  1. Do I want to be producing stuff that quite directly kills people?

  2. If these fights are being ordered against terrorists by a democratic country, is it really that bad?

  3. What difference does it really make? If I don't write this code, someone else will.

Then just last year, I had an interview for a job with a major US (Australian branch) defence contractor. Again, for a job which would most likely involve working on stuff which controls weapons systems.


I never actually DID work on projects which were directly involved with building weapons systems. A big part of me is glad that I didn't. Because I just know that every time I turn on the TV and some story came up on the news where there are blood-covered children screaming (in Gaza, Afghanistan, Iraq, etc), I'd be agonising over the idea that "it is my code that helped do this!", and I'd have nightmares about it.

Now just to be clear, this is totally politically neutral: I'd have this same ethical problem if I had to contract for an Iranian, Pakistani, Egyptian, Chinese, or any other military interest. It's just that pure humane interest which disturbs me. My politics are quite middle of the way and neutral.

I don't know if I could ever work on software which directly "does harm"- however well justified. I just hope I'm never forced (by lack of other opportunities, etc) to consider such jobs again......

share|improve this answer
+1 for a frank discussion about a position many programmers have been in. – Macneil Dec 31 '10 at 15:31
+1 For very good points, and particularly for giving a damn. – Orbling Dec 31 '10 at 15:57

You might want to take a look at the ACM's "Code of Ethics" which gives 8 general "moral imperatives" as well as additional professional responsibilities.

share|improve this answer
Thank you that was very useful. – ahmed Jan 1 '11 at 13:37

IMHO, technology is neutral. People who use it (end users, if you wish) decide how it will be used, and for what, and they're the ones who face the consequences for all their actions.

As the old saying goes "Guns don't kill people. People kill people." alt text

share|improve this answer
It's not guns that kill people, it's the bullet holes. – Lennart Regebro Dec 31 '10 at 13:47
I've never agreed with that statement. I would agree for kitchen knives or a chainsaw or something. But hand guns really have no purpose other than causing injury or death, the lack of an alternate use means that is what they are for, what they do, so they do kill people. – Orbling Dec 31 '10 at 13:50
@Orbling - make allowances for conciseness. There are multiple reasons to kill someone, some (in the right circumstances) justified. "Guns don't kill people in a moment of anger or in the course of committing some other crime" lacks a certain something. Also, the threat in itself can sometimes be what's needed to save a life, so pedantically guns can have another attention-getting purpose. I'm not for a US-style policy on guns at all, but the there are rational arguments on both sides. – Steve314 Dec 31 '10 at 14:11
@Steve314 : Thing is, you can extend this argument further to atom bombs. But I wouldn't call that a neutral technology... – Joris Meys Dec 31 '10 at 14:30
@Orbling - I'm not sure that the use of stampeding animals as a weapon adds much to the - oh, hang on, I think I'm being over-literal about the horse thing. – Steve314 Dec 31 '10 at 15:00

In the light of the "guns don't kill people" argument, I draw the line with the original purpose of the coding. Almost everything can be abused (you can kill somebody with a pencil if you try hard enough). Yet, if the intent of the code is good, that shouldn't stop you from writing it. If the intent of the code is to harm somebody, it doesn't matter any more who it will harm. I wouldn't be able to do it, as harming will be the only use for it and sure as hell that won't only be used by Old Shatterhand and Superman.

Nobel invented dynamite for mining purposes and in the process changed the face of war. But sure as hell he also saved quite a miner's life, avoiding accidents with nitroglycerine. So is that moral? I guess so, even when he was described as "le marchand de la mort" in a french paper.

share|improve this answer
+1 Many of those involved with nuclear research regretted their work, scientists discovers things, engineers build them, and very many people find uses for them. I think it is time to stop for scientists and engineers if the foreseeable use is very bleak. – Orbling Dec 31 '10 at 15:59

This may be somewhat anecdotal, but still useful.

I was taught "The Mum test" at university, during a software development practice module.

If you'd be ashamed to tell your Mother that you'd do something. Don't do it.

share|improve this answer
A lot of students fail that test so very regularly. – Orbling Feb 9 '11 at 2:45

I don't think there is a difference between being an ethical programmer and an ethical person. Hence the attributes of an ethical programmer are the same as for anyone else.

Then we can discuss each of your examples, but they are really all the same as any ethical conundrum. You need to ignore the complexities of real life and look at only the ethical question posed out of context. And that can be enlightening, but ultimately it's an intellectual pursuit with little contact to reality.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.