3 ms·
Yes, because C++ isn't good enough to handle complex projects that require performance AND safety, few bugs. Like the whole F-35 platform. Hardly old and rottin
by erikbye 9y ago
Yes, because C++ isn't good enough to handle complex projects that require performance AND safety, few bugs. Like the whole F-35 platform. Hardly old and rotting. If you know what you're doing you can write safe and performant code using this language. I'll let you know though, it's a trick not that many people know how to perform, and it's not a fault of the language, but bias and misconception. But sure, for the next JSF program, let's just try something new and immature.
It's weird how people can't fathom that we're not all using their favorite language for real-time, safety-critical systems. Don't you think it's with good reason? That, in billion-dollar projects, all options have been considered? Everyone is using C and C++ for this purpose. From BAE to JPL.
- pjmlp 9y agoLarge scale projects aren't always about technology. Hiring process, politics and developer salaries also play a big role.
- erikbye 9y agoDoesn't change the fact that no other language than C and C++ can be used for these systems. Same for complex and demanding video games, which has a lot of the same requirements and characteristics as safety-critical real-time systems. Plenty of game devs dislike C++, but right now, nothing else is feasible. One of these devs is Jon Blow, who's apparently so fed up with the language that he's put a lot of effort into one of his own. Several big industries use C and C++ because there is no other viable option. One day, other languages might be, but that day is not here. Go ask the Rust or D guys if their language and tools are ready to replace C++ for the F-35 project.
- pjmlp 9y agoAda, SPARK and Real Time Java are used on those systems as well. Regarding games, most AAA game engines are hybrid, with C++, C and Assembly only being used for the graphics and audio processing core. Everything else on the engine is a mixture of D, C#, Blueprints, Lua, Python, Flash, Lisp, in-house scripting language, depending on the studio.
- erikbye 9y agoAda usage has declined a lot. F-35 is primarily C++, Ada percentage is meager, and I haven't even heard it confirmed that Java is used for anything critical, but I wouldn't be surprised if it's used for some ground control stuff. NASA uses Javascript for a lot of their non-critical systems. Ada was highly specialized, and its use came with strict requirements (e.g., processor type) that have made it difficult to continue its use, not to mention lack of knowledgeable developers. In another turn, less strict DoD requirements have made it easier to use other languages. It's been quite a few years since Ada saw heavy usage in DoD projects, though it still has relevance. The legacy code base is huge. I never meant to imply that games are comprised of only C++. Of course, you are right: a game and its tooling consist of several languages. Unreal Engine's build system is C#--but as you say, the core systems which makes sure everything's executed in time, rendering, physics, audio, are C, C++ with a bit of assembly. And look at what Unity has to do with IL2CPP to increase performance. Unity has terrible performance because of Mono, but their work on the compiler and job system should start to pay off. In the case of Unreal Engine, you gain a lot of performance by using C++ instead of Blueprints. Even so, Blueprints already compile to bytecode and is ran in a VM and from there they call native C++ functions, they're not interpreted as is. Not that that has much relevance to what we're talking about, perhaps, but it does show that making a system like Blueprints is a significant performance compromise you always try to make up for. Epic recommends you use Blueprint Nativization (generating native code from your BPs) for increased performance, and just use C++ outright for heavy lifting parts. It's not without reason that Epic decided to drop UnrealScript and just use C++ as their scripting language, as well. This comment came to be about Unreal Engine. I don't want to detract from Blueprints though; they're great at what they do. And not to be thought of as just visual scripting for people who can't program or something for only your artists/designers to use. A mistaken thinking many seem to share. It's best to use a combination of the two for easy gameplay scripting and iteration. Just write C++ and expose it to your BPs.