I have a vintage 1960s Mustang that gets 14 miles per gallon and consumes a quart of oil about every 1,000 miles. We also have a 2004 Volvo wagon that gets 20 MPG and enjoys regular oil change intervals. (I use a Google spreadsheet to track mileage and maintenance statistics for all our vehicles.) The Volvo passed emissions testing in its most recent smog test, but failed the inspection because of a trouble code saved in the computer.
Lesson one: never buy a Lemon Law vehicle, even if the seller says it has been fixed. If a car was marked as a lemon, it will be indicated with a red box on the title -- you can't miss it. We bought the Volvo for thousands less than the going market rate due to its lemon law status. But now, we can't get it to pass smog, because three different Volvo repair shops have been unable to fix the problem (at least, within a reasonable cost envelope, which I consider to be under a thousand dollars) that keeps causing the computer to throw a trouble code for one of the sensors.
"No problem," I say. "I'll just pay the registration fees, and drive with an incomplete registration until I have the time to focus on fixing it." My very first car (Ford Taurus) was in the same boat when it got totaled in a rear-end collision with a hit-and-run driver. At the time, the Whittier police indicated driving with an incomplete registration was not something they cared about (which makes sense to me -- it's insurance that is really important to keep up to date).
Well, as luck would have it, I was recently pulled over on the 405 north while traveling up to meet family for dinner. I was in the exit lane, cruising along at about 60, going slightly slower than mainstream traffic. I noticed the highway patrol in the pull-out but thought nothing of it, until I saw him following me in my rear view mirror -- and indeed, he pulled me over at the first opportunity after the freeway exit. Apparently he noticed my 2010 registration sticker. When he had me stopped in a gas station he asked me to roll down my rear passenger window. All the windows on the wagon are legally tinted with very dark tint, so I realize he was probably hoping for a drugs / illegals smuggling stop. In the end, he issued me a non-monetary infraction ticket, also known as a "fix-it" ticket, and explained that my registration was so out of date he could actually impound the car.
Long story short, I'm back to driving the Mustang. Thanks to the California smog exemption laws it doesn't need to pass smog. So now I'm polluting more, burning more gas, and driving a far less safe vehicle, not just for myself but for other drivers around me (the Mustang's dynamic stability is a complete joke -- my wife once suffered a rear tire blowout, and it executed a 360 spin as a result).
The reason a car fails the smog inspection due to trouble codes -- also known as the "check engine light" being on -- is because it is assumed there is some correctable problem with the engine that could negatively affect emissions. But in my case, the emissions are fine. In fact, the emissions from the car that has to pass smog and can't are unquestionably far better than those of the car for which smog testing is not even required. So in order to follow the explicit "letter of the law," I am in fact forced to go against the spirit of the law itself.
I would say this is just one example of when it is better to just follow your own judgment rather than blindly follow the law. But eventually, as evidenced in my own example, the executor of the law just might catch up to you; even when you are least expecting it.