Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Today my lecturer mentioned the reason why the aircraft system is programmed in assembly language is due to the program being written have less error . Is this statement true ? Because when he asked about our opinion I said assembly can create faster program thus it is a good language for real-time oriented aircraft system program . I search around google but can't seem to find an article clarifying my lecturer's statement .

share|improve this question
22  
Either you misunderstood your lecturer or your lecturer is an idiot. –  Paul R Oct 23 '12 at 7:55
2  
You do not want to write real-time critical-equipment control software in assembly. There are much better languages available for both real-time-software development and critical software development. –  Michael Kjörling Oct 23 '12 at 8:08
4  
Just wondering about your lecturer's age. Anyway, he might have only tried to point out, (kinda failing, apparently) that a number of modern languages, such as java, are off-limits (java has this spelled out in it's accompanying license, btw) for aircraft-related mission-critical applications. –  ZJR Oct 23 '12 at 8:43
1  
@ZJR: Actually, AFAIK, a German UAV manufacturer uses Java for the flight control system. Maybe they bought a different license? –  Jörg W Mittag Oct 23 '12 at 11:56
1  
@JörgWMittag: a UAV might be able to kill people by other methods, but the 'U' means a failure of flight control means it isn't immediately jeopardizing human life. The Java license says it isn't suitable for mission-critical systems, but that doesn't prevent anyone from making that choice. –  DaveE Oct 23 '12 at 17:59

2 Answers 2

up vote 28 down vote accepted

Your lecturer's statement is provably false. The Joint Strike Fighter's control code is written in C++. The 777 from Boeing uses 99%+ ADA. The JPL uses mostly C to drive spaceships.

I'm sure there are more examples but I suspect many are proprietary or classified.

Here is a paper that goes into some detail on the subject of testing avionics software on a more general level.

share|improve this answer
    
Some NASA projects also used a Lisp dialect in the past. A German UAV manufacturer even uses Java. –  Jörg W Mittag Oct 23 '12 at 11:55
    
The B2 bomber's was recently rewritten in C. Source: tech.slashdot.org/story/08/07/14/1934228/… –  user16764 Oct 23 '12 at 14:15
    
Back in the Dark Ages (early 1980s), F-16A/B used assembly language for the Stores Management Set and JOVIAL J3B for the Firecontrol Computer. F-16C/D used JOVIAL J73 for everything for the first few blocks, and I believe they switched over to Ada in later years. I don't know what they're using today. –  John R. Strohm Oct 23 '12 at 16:51

I work on OBOGS, which is a component that gets plugged into various aircraft. We typically use C for the devices that fly, but looking through the historical files, there are a couple of assembly projects in there.

It's fashion, honestly. Languages rise and fall. The reasons people use one or the other vary all over the place and are mostly subjective. I find it completely plausible that someone at some point argued that assembly was the right choice for some project somewhere entirely because it would have less errors than in any other language. And he was probably right, but that's because the guy didn't know how to code in C worth a damn. By and far the best language for the job is the one you know. (And the best language for your personal growth is one you don't.)

You can objectively say that assembly is closer to the hardware, less abstracted, more direct, with more instructions to the same thing in other languages. You can even say that it's in the realm of possibility that assembly can be written to cut out overhead and be smoking fast. If you know what you're doing. But as for error-prone-ness, speed of development, readability, and the ability to cure cancer? All that depends on the ability of the programmer and what they've worked in for the last 20 years. Measurements of which projects with which language have X amount of bugs are subject to sociological factors, largely making them worthless metrics. No, it's all just so much fashion.

It's good to know what your code boils down to, so I'm going to say that it's important to learn assembly. If only a little. But I wouldn't write any avionics in it.

share|improve this answer
    
I the end, writing assembly means less machine code overall if you know what you're doing, and you know pretty much exactly what the resulting machine code will look like; you don't have to trust a compiler to get it right for you. –  Hawken Jan 6 '13 at 2:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.