9

Would you trust an aircraft autopilot written in Java, or would you prefer C++?

Comments
  • 9
    I'd trust whatever was written the best with the most comprehensive tests.
  • 12
    Rust in an airplane is usually not good.
  • 6
    I trust HTML the most.
  • 3
    @Root Where I come from, simpler is better.
  • 5
    I would trust nothing but 8086 assembly
  • 7
    I was told at one time the legal agreement for Java states you cannot use it for safety critical things such as flight control or nuclear reactors.
  • 0
    @lxmcf We're in the same boat then
  • 1
  • 2
    @heyheni *slow clap*
  • 4
    Coming from the sector, autopilot software must be real time software for obvious reasons. Java can not be used for realtime software for various reasons. So c++ or even c is enough, with rigorous tests.
  • 0
    @aviophile :) Real-time... Don't hear it that often these days
  • 1
    I'd trust both, if the developer is competent.
  • 1
    The advantage of Ada is that it is designed to prevent runtime errors, and makes it really difficult to create buggy code. As much as I disliked using it, it is a great language for stable, bug free systems.
  • 2
    @iAmNaN of course Ada makes it difficult to create buggy code - but only by making it difficult to create any runnable code at all.

    @aviophile C is even better here because it ensures that people don't use C++.
  • 3
    @Fast-Nop well, yes. 🙃 We used to take our requirements and implement them in C++, because they were for training systems, and then apply for a waiver, stating that the work had already been completed. Always got the waiver. But for criticsl systems, where a runtime failure is not an option, the extra time it takes to do it in Ada is worth it. Don't want the guidance system to land the package on the wrong coordinates.
  • 1
    @aviophile Java can run real-time if it's the only thing running :D ...meaning that there is no JVM because the thing running it executes bytecode directly
    Examples: iButton, debit cards, DVB decoders(the decoder cards look pretty similar to debit cards - well it turns out they run java too) , SIM cards...
  • 0
    @bytecode

    True. Java can run in real-time. Problem is, when you're a Java app(let), you are at the mercy of the JVM. I have extensive experience writing code for JCOP, and it has its weird quirks and bugs; not to mention because it's fucking Java you don't have the blessing of malloc()
  • 2
    @Fast-Nop @bytecode as long as java uses heap, it can not be hard real time.
  • 2
    @bytecode even c with dynamic memory can not be hard real time. In C, heap is optional but in Java, it is only heap iirc.
  • 1
    @aviophile I'm using static allocation anyway so that no runtime issues like out of memory, memory fragmentation or unpredictable runtime can occur. Even the stack size needs to be thoroughly analysed so that it won't overflow.
  • 2
    @Fast-Nop you mean in C, right?
  • 1
Add Comment