Discussion topic: Do the ends justify the means?

Example:
Say Bob told you to kill Joe, or Bob would kill 5,000,000 people. Would it be better to to kill Joe to keep Bob from killing the 5,000,000?