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.
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.
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.
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.
>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.
“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….
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?
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.
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.
‘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.
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.
How much of that is just drivers or alternative implementations of the same basic functionality (think multiple schedulers or heck filesystems) though?
You are using “kernel” generously. The core itself (the microkernel as it is now being called) is maybe 10,000 lines of code.
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 🙂
You DO realize Tyler knows nothing about Technology but likes to present a Grand narrative.
*
“pure bullshit”
endless fake news from the New York Times. Typical NY Times readers will never notice
This count probably also includes large amounts of machine generated code created from far more compact high level statements.
+1. Repeated kernels and libraries
Traffic accident deaths have increased for 2015 and 2016. I wonder if all the new safety technology is backfiring?
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.
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.
Exactly.
Miles travelled have also increased.
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.
>I wonder if all the new safety technology is backfiring?
No.
Everybody is on their freaking phone. EVERYBODY.
“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.
I wonder if all the new safety technology is backfiring?
No, I think it’s immigration.
That is because they simply don’t delete old code and it just builds up — a car software engineer told me so.
Brah, do you even source control?
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.
All that to motor over to the 7-11 and back for a half-gallon of milk and a pack of smokes.
Your dad said he was going out for cigarettes, too?
What was the last car that had no code? Hmm, that’s a Pearl Jam album..
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.
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.
+1
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.
Cars therefore ARE as poorly engineered and designed as the recall announcements proclaim.
THAT is Progress at work.
I think the conclusion here might be that those programming in the auto world are doing it poorly.
It’s much more likely that autos are importing code from the personal computing world, where programming is done poorly.
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.
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.
+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.
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.
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.
I’m surprised the F-35 doesn’t have some horrifically inefficient code behind it.
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.
How do you measure the lines of code on a deep learning network that I trained, rather than programmed?