The Future of War

The wars of the future might be fought with autonomous machines, drones and weapons that can act on their own. But is it ever OK to write code that can kill?