The Clean Code Blog

by Robert C. Martin (Uncle Bob)

Just Following Orders

28 August 2017

The year is 2006. Executives at VW know that their diesel engine can not meet American emissions standards. So they ask the enginers for a solution that does not require a redesign of the engine.

Imagine the scene in that meeting room. What was said? What was agreed to? We may never know all the details; but it’s clear that the executives asked the engineers to find a way to defeat the emission tests.

Now think of the engineers. What a cool problem to have to solve? No, really! Imagine how much fun it would be to figure out some sneaky way to bypass the emission test. How would you do it? Could you do it in hardware? Could you do it in software? How could you detect that you were on a test stand?

“Wait!” one of the geeks says. And he looks around the room, making sure all eyes are on him, playing the timing just right. “On a test stand, … the wheels are spinning, … but the car is not moving.”

“Oh, wow!” another engineer says. “Could we use GPS to tell if the car is moving?”

Imagine the brainstorming, the “good” ideas. The coolness of knowing that there’s a really nifty solution to this problem.

Imagine how pleased the executives would be with this really cool engineering solution. Imagine how proud the engineer were.

And now one of them, James Liang, is going to jail. There will be others who will follow him there. Their defense, of course, was that they were just following orders. They were just protecting their jobs – making sure they could feed their families. But that defense didn’t fly. It’s jail for them. A big time in the big house:

“The 40-month jail sentence was [] at the high end of the maximum allowable five-year term for his crimes. Liang’s lawyer had argued that instead of jail time, he could be sentenced to a period of house arrest, arguing that he was only following orders out of ‘misguided loyalty to his employer.’“

And it’s fines. Big fines for a big screwup.

“Despite federal prosecutors only asking for a $20,000 fine, Michigan district court Judge Sean Cox decided to make an example of the techie and ordered he pay 10 times that as a deterrent to other auto engineers and executives.”

See this article.

Engineers take note: Your employer can’t cover for you. Doing your job does not mean that you just follow orders. The courts are going to hold you to a high ethical standard, even if your employer does not.