5 ms·
Interesting link. Can anyone explain why a car needs so much code?
by bl0b 7y ago
Interesting link. Can anyone explain why a car needs so much code?
- Judgmentality 7y agoInstead of having a single computer that stores all the code, automobiles have lots of embedded systems with their own code and hardware, and lots of systems designed for validating safety critical functionality. When I say lots, I mean it's usually several dozen and can be over 100. Since many of these need to meet special regulations and oftentimes require hard real-time characteristics, this tends to add to the complexity significantly.
- 6nf 7y agoI mean ... we all know a car does not need that much code
- TylerE 7y agoReally, why do you know that? I would expect a car to have tons of code. Think of all the functions... Engine management, Engine monitoring, Powertrain control, Emissions, Diagnostics, Infotainment, Satnav, Climate Control, Traction Control, ABS, Anti-collision radar, Cruise control, Lane keeping, Backup camera, Parking sensors... Now keep in mind that these hundreds of components exist in many many possible configurations so the system needs to handle having certain hardware available or not, and also handle a multitude of failure modes gracefully.
- dkersten 7y agoPerhaps because cars ran just fine (albeit with fewer features) for a long time with zero lines of code.
- dzhiurgis 7y agoSo did horses without any gasoline
- ClumsyPilot 7y agoYeah, and so did banks, and so did airplanes.
- dkersten 7y agoSo the more important question is: did adding software improve things (enough to be worth the “cost”)? With cars, there are certainly many things where it did improve things: satnav, reverse camera, traction control etc, but also some where it made a perfectly working system worse (ie the “fixed” something that wasn’t broken): touchscreen dashboards.
- 6nf 7y agoBecause my car has exactly zero lines of code and it runs just fine.
- _trampeltier 7y agoI guess in cars they use less (public) librarys because of safety. So there own libs are included in LOC. If you look at a modern Microsoft licence, they list tons of used open source libs in there products. I guess if you include all the librarys, the LOC number should be much higher.
- numpad0 7y agoApparently a lot of it is just generated templates coming from commercial SDKs. Adding to that, a car is a set of distinct embedded systems interacting in a sort of a ladder network topology rather than a vertebrate analog like multi-core PCs, so a lot of code in a car would be redundant or has little footprint restrictions.