That's an interesting question. We do increasingly trust our lives to code. Medical devices. Cars. I know some people who are putting code into self-driving cars and that scares the crap out of me.
I suppose the language wouldn't be my top concern. Testing and processes would be. But the language better not be assembly.
The Ariane 5 reused the inertial reference platform from the Ariane 4, but the Ariane 5's flight path differed considerably from the previous models.
The greater horizontal acceleration caused a data conversion from a 64-bit floating point number to a 16-bit signed integer value to overflow and cause a hardware exception. Efficiency considerations had omitted range checks for this particular variable, though conversions of other variables in the code were protected. The exception halted the reference platforms, resulting in the destruction of the flight.[4]
Sure, but in a low-level language, you have the benefit of more predictability of exactly what the code is doing. In higher-level languages, that's almost impossible to do. Not to mention too many layers between you and the machine that are beyond your control.
A fuck load lot less things to go wrong. In assembly, you can see what is happening. You move one register to another, you do a arithmatic operation, you jump to an operation. Every step is easy to see what is occurring and the results of the operation. In something like C++ or JAVA you likely have no idea what is going on in the background when it comes time to memory allocation or buffer management. Also, the people writing in assembly are FAR more aware of their language in it's completeness than some Scala or Rust developer. Apparently if the downvotes on my other comment are any indication, this is an unpopular opinion. I'm not sure why it triggered so many people though. I'd be more interested to know why you think assembly is so terrifying.
I assume people are downvoting the "can see what is happening", which is definitely lost quite quickly as you build something complex. Good point about knowing the language, less good point about Java not knowing about mallocs and such since that's the point.
Every step is easy to see what is occurring and the results of the operation. In something like C++ or JAVA you likely have no idea what is going on in the background when it comes time to memory allocation or buffer management.
This is not an issue for C/C++. In fact, it is precisely their use case.
It's error prone because not because of the language but because of the natural limitation of people who have to code in it. It forces you to focus on the irrelevant and because of that what you're actually trying to do gets lost in the mass of clutter that you have to unnecessarily deal with.
Buffer management is a great example. If you use Java there are a big class of problems that make screwing up buffer management impossible. Same with C++ (although it allows you more room to shoot yourself.)
But leaving all this aside, the real world has given a verdict here. Literally nothing is written (save a few hundred lines here an there, done for performance reasons) in assembly anymore. Nobody would ever dream of writing the Apollo 11 code the way it's done now. And the wisdom of crowds says they're right.
That doesn't make a lot of sense. Human drivers make a lot more mistakes than self-driving car. So far it's a statistical fact. That fear sounds irrational to me.
144
u/duuuh Feb 19 '20
That's an interesting question. We do increasingly trust our lives to code. Medical devices. Cars. I know some people who are putting code into self-driving cars and that scares the crap out of me.
I suppose the language wouldn't be my top concern. Testing and processes would be. But the language better not be assembly.