Car fact of the day

by on June 9, 2017 at 3:00 am in Web/Tech | Permalink

Twenty years ago, cars had, on average, one million lines of code. The General Motors 2010 Chevrolet Volt had about 10 million lines of code — more than an F-35 fighter jet.

Today, an average car has more than 100 million lines of code. Automakers predict it won’t be long before they have 200 million.

That is from Nicole Perlroth at the NYT.

1 Viking1 June 9, 2017 at 3:22 am

My assertion is that marginal value of the final line of code is down. It was actually hard to come up with a relevant comment to such a topic as this.

2 Anonymous June 9, 2017 at 6:52 am

If by final line you mean literally the final line in the file, it’s probably a semicolon or something that you have to have to get the code to even compile. If instead you mean the last line that was added to the code, it’s probably some bug fix that prevents the engine from spontaneously exploding during the driving or something. In both cases the marginal value of the final line is very high.

Bloated code often results from no-one wanting to spend the time, money or effort to refactor all the decade old legacy code to better fit the requirements of today. The result is that when you write a new feature that the people who designed the architecture of the old code never really had in mind, you have to spend more lines of code. Also, bloating of the code is kind of self-reinforcing: once the code is a horrible mess, it becomes more difficult to change or rewrite anything without breaking something else and as a result, no-one wants to touch the old parts of the code and just leave them there.

The point is, assessing the marginal value of any single part of the code is kind of difficult since, in a complex program, things interact with each other and the value of something in the code depends on how everything else in the program is written.

3 GoneWithTheWind June 9, 2017 at 10:06 am

That there is code at all is significant but the length or amount of code is not. That bad code exists and may be more prevalent in longer programs can be problematic but do not assume that the length of the programs is equivalent to the potential problems. Nor does the length imply greater technology as was implied by comparing it with a jet fighter. I’m not sure there is a story here.

4 The Other Jim June 9, 2017 at 10:22 am

>I’m not sure there is a story here.

The story is that NYT reporters and editors have no idea what a “line of code” means, and they are (correctly) guessing that few of their readers do either, so they figure they should write a story about there sure are a lot of them in modern cars, and it sounds scary so you should worry about it and you’ll probably get killed by a typo.

5 Ricardo June 9, 2017 at 2:43 pm

“do not assume that the length of the programs is equivalent to the potential problems”

I would bet that the correlation is at least 0.8….

6 Tony Apuzzo June 9, 2017 at 11:01 am

In some ways you have it backwards. The marginal value of the last line of code is in some ways the most important. 95% of the code is providing basic background functions and the unique functionality is the ‘last’ 5%. What is the marginal value of the carpet installed in a building or the lock on the front door of a brand new office building?

7 foobarista June 9, 2017 at 3:25 am

My guess is these linecounts are mostly in RTOS code that’s repeated in numerous components. The amount of actual non-repeated code is likely far, far less than 1% of these codecounts.

8 maros June 9, 2017 at 5:26 am

Exactly, pure bullshit aimed to impress, not to inform. No organization has a collective cognitive capacity to develop and main 100M lines of actual, real code. Most likely they double count or include the libraries and operating system in the total count.
Installation package of my company’s flagship product is 1.3GB. According to their methodology, that would be mean 17M lines of code. In reality, 90% of it is accrued by third party libraries.

9 prior_test2 June 9, 2017 at 6:27 am

‘No organization has a collective cognitive capacity to develop and main 100M lines of actual, real code.’

Particularly over a large number of ever changing platforms.

10 Anonymous June 9, 2017 at 6:58 am

Linux kernel has more than 20M lines of code. It’s less than 100M, but it’s quickly getting there. Given the size of the project, it’s remarkable how lean and well functioning the Linux kernel actually is.

11 Someone from the other side June 9, 2017 at 2:00 pm

How much of that is just drivers or alternative implementations of the same basic functionality (think multiple schedulers or heck filesystems) though?

12 Ricardo June 9, 2017 at 2:49 pm

You are using “kernel” generously. The core itself (the microkernel as it is now being called) is maybe 10,000 lines of code.

13 foobarista June 9, 2017 at 3:03 pm

and the way they do these “80 bazillion lines of code” counts would be to “count” the total lines in the OS, Linux kernel, etc as separate. So, if you have five gadgets with a Linux-based or Android RTOS in them, you’ve hit “100M lines” – even with zero lines of app code 🙂

14 Just Another MR Commentor June 9, 2017 at 7:37 am

You DO realize Tyler knows nothing about Technology but likes to present a Grand narrative.

15 ryanL June 9, 2017 at 7:50 am


“pure bullshit”

endless fake news from the New York Times. Typical NY Times readers will never notice

16 jay June 9, 2017 at 9:45 am

This count probably also includes large amounts of machine generated code created from far more compact high level statements.

17 Silicon Valley June 9, 2017 at 12:37 pm

+1. Repeated kernels and libraries

18 Steve Sailer June 9, 2017 at 3:48 am

Traffic accident deaths have increased for 2015 and 2016. I wonder if all the new safety technology is backfiring?

19 Jeff R June 9, 2017 at 8:38 am

I have a suspicion that back-up cameras are a real mixed blessing. People lock their eyes onto the screen and forget to use their mirrors to look for peripheral objects.

20 Yancey Ward June 9, 2017 at 10:14 am

I have almost quit using the backup camera for anything more than backing out to the end of the driveway, or as a quick check before putting the vehicle in motion in the first place. It is practically useless as a safety device elsewhere since all the primary dangers come from the cross traffic. I have also definitely noticed more people backing out in front me when they shouldn’t in parking lots in the last 10 years, and I suspect it is because they are staring at the screen and not checking for oncoming cross traffic.

21 Jeff R June 9, 2017 at 11:32 am


22 Ted Craig June 9, 2017 at 8:44 am

Miles travelled have also increased.

23 Neil June 9, 2017 at 9:31 am

I’ve never been in a Tesla, but even in nice-ish cars, I see little new safety tech beyond backup cams. Maybe brakes have gotten even better and people have re-calibrated braking time/between-car distance in an overconfident way.

I was assuming most of that new code was for stuff like Bluetooth, touch screen audio systems, and GPS. In my limited experience, texting and more bikers could be more significant differences. GPS that accounts for traffic also often makes people take a billion turns.

24 The Other Jim June 9, 2017 at 10:24 am

>I wonder if all the new safety technology is backfiring?


Everybody is on their freaking phone. EVERYBODY.

25 JWatts June 9, 2017 at 3:27 pm

“Everybody is on their freaking phone. EVERYBODY.”

I was watching a woman in the car in front of me commuting in yesterday. It’s the new normal for people to be looking at their phone when the lights are red and not to look up until it goes green. She never looked up. For the mile or so, I was behind her I never even saw her glance up. When the car in front of her started moving she would take her car off the brake and let the car drift and then let a huge gap build up and then jerkily tap the gas after a few moments.

I can’t imagine her driving like that for a year before she rear ends somebody.

26 Kris June 9, 2017 at 12:29 pm

I wonder if all the new safety technology is backfiring?

No, I think it’s immigration.

27 JD June 9, 2017 at 4:24 am

That is because they simply don’t delete old code and it just builds up — a car software engineer told me so.

28 Doug June 9, 2017 at 11:02 am

Brah, do you even source control?

29 Alex FG June 9, 2017 at 2:00 pm

He’s correct though: if one of the thousands of car components is unimprovably developed (or rather improvement is unbeneficial) it will be left unchanged.

30 chuck martel June 9, 2017 at 6:45 am

All that to motor over to the 7-11 and back for a half-gallon of milk and a pack of smokes.

31 Daniel Weber June 9, 2017 at 11:11 am

Your dad said he was going out for cigarettes, too?

32 Doc at the Radar Station June 9, 2017 at 6:51 am

What was the last car that had no code? Hmm, that’s a Pearl Jam album..

33 Alex B June 10, 2017 at 4:15 am

In the UK, the Ford Sierra has a reputation of being the most modern car that even an amateur mechanic can service on their driveway.

Even that has an engine management system, though, so I think you’d be looking at going back a bit further again before you got to a car with no code whatsoever.

34 Axa June 9, 2017 at 7:17 am

It would be good to know which fraction of the code is dedicated to “car” features: engine control (fuel, pollution), ABS, electric steering, electronic stability, etc and which other fraction is dedicated to make your car a rolling living room: electronic displays, GPS, seats with preset positions, contactless keys, remote start.

I would not be surprised if a radio that plays MP3s from a USB takes many more lines of code than the electronic stability module.

35 Peter Boysen June 9, 2017 at 1:27 pm


36 Slocum June 9, 2017 at 7:43 am

And most of that code (and the increase) I’d bet it is in the useless, annoying ‘infotainment’ system that makes it more difficult and dangerous to do formerly simple things like tune the radio or adjust the air conditioning.

37 Edward Burke June 9, 2017 at 7:45 am

Cars therefore ARE as poorly engineered and designed as the recall announcements proclaim.

THAT is Progress at work.

38 john June 9, 2017 at 8:04 am

I think the conclusion here might be that those programming in the auto world are doing it poorly.

39 wiretap June 9, 2017 at 10:28 am

It’s much more likely that autos are importing code from the personal computing world, where programming is done poorly.

40 John Mansfield June 9, 2017 at 8:27 am

A few years ago I visited the Green Bank Radio Observatory in West Virginia. Among the things they do there to eliminate radio frequency sources is that they operate a little fleet of 1960s and ’70s vehicles with diesel engines (eliminating spark plugs) and no electronics.

41 derek June 9, 2017 at 9:40 am

Cars are full of devices with programmable microcontrollers. A local manufacturer makes an interior light which you touch with a few simple functions. It is led, microprocessor based. The million lines of code probably include all the libraries each one of these microcontrollers are programmed by. There are a huge number of different microcontrollers, each with their own libraries.

Interestingly it isn’t one large system with central control. Much of this is discrete components mostly self contained with maybe a couple inputs. Oddly it works, even with the constantly changing product cycles.

42 The Engineer June 9, 2017 at 12:06 pm

+1. The proliferation of microcontrollers is behind the proliferation of code.

How about those “one touch down” power windows? There is an 8 bit controller at the heart of that feature, for example.

Automatic headlight control? 8 bit microcontroller.

Rain sensing wipers? That gets a microcontroller as well.

43 derek June 9, 2017 at 8:48 pm

I looked at the code for a very simple device they were making. You wouldn’t even know there was a microprocessor in it, it was so simple. The largest code segment was a routine that wrote a number to every memory address, the number being the op code to reset. There were a few counters and other bits, and some simple input to output logic. If there was a stray pointer or something likely it would reset.

Lines of code is not very useful as a metric.

44 Art Deco June 9, 2017 at 9:47 am

The man who repaired my car for 17 years was fond of a story about a customer who asks a repairman about a particular piece of computer controlled equipment:

Q: What does that do?

A: [shrug and smile] It breaks.

The addition to utility of the 10-fold increase in lines of code is very difficult to discern.

45 Hadur June 9, 2017 at 11:18 am

I’m surprised the F-35 doesn’t have some horrifically inefficient code behind it.

46 JB June 9, 2017 at 12:21 pm

There is a lot of reuse of large bodies of code. The Google Chrome browser code is one such example:

Recently a bunch of applications use the chrome browser (basically) as the most fundamental chunk of their code. These aren’t websites, they effectively include their own private copy of chrome as a basis for building their application with web technologies like javascript. Many other applications embed large programs like chrome within them to show web pages inside the app. A lot of the increase in lines of code for applications comes from decisions like this.

47 Interguru June 9, 2017 at 12:51 pm

How do you measure the lines of code on a deep learning network that I trained, rather than programmed?

48 athleticsweekly June 25, 2017 at 1:27 pm

CathyHogl Portugal PamelaOve
UIGGildac Italien JuniorLun
AgnesWehr Spanien BreannaCo
AlexOrmis Chile TaneshaEl
SonjaMcKi BVB Borussia Dortmund DarrenLam
TomHnacur Paris Saint Germain SabineSto
GaryHerli Tjeck DustyDowd
EugenioSa Sverige Kristofer
WalterBai Nederlanderna VirgilMac
JoannaImg BVB Borussia Dortmund AgnesKebl
BobbyeKor Uruguay JeanaRasc
AnnaDowz Spanien ValWalkle
KarenGrif Turkiet KarolinHo
Justinakj Los Angeles Galaxy VeronaMcg
TangelaCh Brasilien GuyRodeni

Comments on this entry are closed.

Previous post:

Next post: