Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Programming language for engineering

  1. May 20, 2007 #1
    Hi,

    I read somewhere that aerospace engineers use the language Ada to write instructions for aircraft/spacecraft systems. I also read that the Boeing 777 was primarily programmed with Ada. This kind of makes me want to learn some Ada over the summer, just to get some exposure for later.

    However, I know that C++ is used primarily at my university for engineering, and I already took an intro C++ class and did well in it, so I'm not sure if I should learn more C++ or begin Ada. Or, I could learn MATLAB more formally, since I was only exposed to it for about two weeks in class.

    So I suppose learning MATLAB would be advantageous, too. What do you all think I should do for now?
     
  2. jcsd
  3. May 20, 2007 #2
    MATLAB is one of those languages you don't need to learn. ITs really simple unless you plan to make GUIs. The only thing about matlab you need to really know is the file layout(i think its 1 function per file) and vectorized operators, everything else you can search in Matlabs help or online.

    U should really talk to a prof or someone in the industry. But perhaps learning C++ packages in the field or ADA would be useful(never having seen or used it myself).
     
  4. May 20, 2007 #3
    FORTRAN. You may laugh. FORTRAN is highly antiquated - according to many. However, it has continued to be updated up to FT95 -that is, the year 1995 - and is both simple to learn and use, and highly efficient for mathematical and engineering tasks. It can control ports rather easily, and has powerful, readily available libraries of mathematics to use out of the box.
     
  5. May 20, 2007 #4

    chroot

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    There are many kinds of engineering. If you're talking about electrical engineering, MATLAB and C++ are probably the most useful.

    - Warren
     
  6. May 20, 2007 #5

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    While Ada was designed specifically for military (and NASA) aircraft/spacecraft flight software, the language never quite took off (excuse the pun). There are just not enough tools written around the language, not enough programmers who know the language, and not enough projects that use the language.

    The latter is a big factor that militates against the language. Why should a person learn Ada as opposed to some a language with much greater marketability such as C++? Ada is a specialty language with limited marketability. If you decide to specialize in Ada, realize that you may well be restricting your career.

    The first flight software was written in assembly language. Higher-order languages such as Ada and C++ replaced assembly decades ago. Even higher-order languages are beginning to replace Ada and C++. Industry is moving toward automatically generated flight software. Algorithm designers write their designs using domain-specific tools such as Matlab. Software design tools automatically translate those designs into C++ or Ada, automatically generate test scaffolding, and automatically generate documentation.
     
  7. May 20, 2007 #6
    I see the general consensus is to stick to C++ and MATLAB. I guess Ada is out.

    Like what?
     
  8. May 20, 2007 #7

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    Domain-specific languages: Matlab/Simulink for guidance, navigation, and control algorithms, Unified Modeling Language with a host of automatic code generation tools for things like developing finite state machines, etc. This wikipedia article lists several UML tools.
     
  9. May 20, 2007 #8

    chroot

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Python, C#, Visual Basic, etc.

    - Warren
     
  10. May 20, 2007 #9

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    This thread is about aerospace engineering, particularly "instructions for aircraft/spacecraft systems", aka flight software. I don't know of any flight software written in Python, C#, or Visual Basic.
     
  11. May 20, 2007 #10

    chroot

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    The title of the thread said only "engineering." The OP notably did not specify that he wanted to learn a language specifically relevant to aerospace engineering; he only used Ada as an example. It seems you're the only one here making the assumption that the OP is interested only in flight-software specific tools. Perhaps you're right, but the original question was a little vague on this.

    - Warren
     
  12. May 20, 2007 #11

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    The title was vague, but the post was not. Re-read the original post.
     
  13. May 20, 2007 #12

    chroot

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    I read it several times. It contains an anecdote about Boeing using Ada, and a mention that this made him want to learn Ada. It then went on to discussing what languages his school uses for "engineering," in general. He never once said anything resembling "I want to learn a language that will be useful for aerospace design work."

    Lose the attitude.

    - Warren
     
  14. May 20, 2007 #13
    I'm sorry for any vagueness. Let me clarify: I am interested in knowing which programming languages play important roles in engineering, but any information on aerospace engineering in particular is greatly appreciated, too. I'm trying to get an idea on which languages I should expose myself to throughout my university career, and I'd like to use this summer to investigate some of those languages. Thanks for all of your information!
     
  15. May 20, 2007 #14

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    "Engineering" is a very broad topic. The list of languages that play important roles in engineering is no smaller than the list of programming languages, period. Aerospace engineering alone is a very broad topic, as eerospace engineering is very much a multidisciplinary field.

    Note well: Most aerospace engineers are not programmers. From my experience, the vast majority of aerospace engineers who are programmers are truly lousy programmers, second only to physicists and mathematicians (the worst algorithm I have ever seen is the completely unmaintainable/unverifiable/unreadable singular value decomposition algorithm.)

    It is a good idea to learn something about software engineering so you won't be among the ranks of bad aerospace engineering programmers. Aerospace engineering deals with what must be extremely reliable (six nines) and yet highly computerized systems.
     
  16. May 21, 2007 #15
    Let's just cleanly separate things here.

    Of course, extreme reliability must be a property of key in-flight software. I don't really know what this kind of software is typically written in, but indeed Ada was designed with special considerations for reliability. To achieve this,it puts higher than average constraints on how to do things on programmers, and hence belongs to the category of the so called "bondage and discipline" languages. These comments about Ada are just to point out that writing high-reliability (e.g. flight control) software is niche in any engineering field (even aerospace), and one is not likely to stumble upon it casualy.

    The other, prevaling kind of programming that an engineer will typically encounter, is custom software used in various stages of design and development, written for personal use, or developed in-house. This kind of software has no particular need for reliability, as long as it can be coerced into producing verifiable results. Much more important here are rapid developement and ease of maintenance. I like to think of this as new emerging engineering culture -- once there were sliding rules, then hand-held calculators, followed by clunky spreadsheets, and now programming at large should come. A motto: Never make a computation around which you cannot wrap a loop.

    I'd say this falls under the "programming at large" concept above, so to that end I would suggest three things:
    • Last-line, heavy-duty number cruncher: C/C++ and/or Fortran
    • A computer algebra system (CAS): Matlab
    • General purpose scripting language: Python

    The number cruncher is there for computations which need raw speed. Also, they are still holding out as primary tools for writing bigger pieces of in-house software, and most existing computational codes are written using them. I would say that the choice between Fortran and C/C++ here depends on personal preference, and what you happen to be working on. For example, so far Fortran has bypassed me, but by a narrow margin. (In case you wonder, pure C is mostly a subset of C++, but one does need to know which subset and the practice of using it, so I lump it as C/C++ rather than just saying C++).

    CAS are excellent for any own computations and actually any computation that does not require the raw speed. They may also be a less wieldy for planned developer cooperation (revision control, etc.) needed for larger codes, but don't take me on this. I relied on them heavily during my university days. Matlab seems to be the most ubiquotous of CAS, so I recommend that one.

    General purpose scripting languages are the workflow glue. They can be used to link several computational tools together in an automated chain, and generaly help with any computer-related service tasks. Python is highly touted for its cleanliness (something not granted for scripting languages), has large base of usefull add-on modules, and among these some specifically numerically oriented.

    Finally, the particular choices that I listed in these three categories, either are free or have free implementations (as in zero cost, source code), and exist for any imaginable and unimaginable computing platform. I hold these to be very important qualities.

    --
    Chusslove Illich (Часлав Илић)
     
  17. May 21, 2007 #16
    I must add one thing, to keep my conscience at peace.

    Looking through engineering job skill requirements, frequently there pops up the mention of "Microsoft Office", which for computational component means Microsoft Excel. My own experience and some that of some friends, has confirmed that in places Excel is indeed very much used, to the point of being primary general computation tool. Hence, having good command of Excel, and especially of its scripting capabilities (VBA), will be an asset for some job positions.

    There, I said it.

    (I find Excel to be hideous for engineering computations -- actually, spreedsheets in general, Excel just being the prime example. I have tried to use it, but only after being exposed to the tools mentioned in my previous post, and it very much aggravated me.)

    --
    Chusslove Illich (Часлав Илић)
     
  18. May 21, 2007 #17

    AlephZero

    User Avatar
    Science Advisor
    Homework Helper

    What you need to learn is "how to program", not "the details of languages X Y and Z"

    Looking back on my own career, I have probably learned a new language every couple of years. On the other hand, the basic principles haven't changed much. The one exception of object oriented design coming in part way through - though it turned out we were pretty much writing object-oriented systems in Fortran before then, it's just nobody had told us that's what we were doing!

    If you know C++ or Java (I mean you know the language, not you can get by using a small subset of it) then converting to the next language that comes into fashion will be easy enough when you need to do it.

    As for ADA, sure it was used for the embedded systems on the 777. But that represents a smal proportion of the software used to design the 777, and the rest wasn't written in ADA. To put it in perspective, I worked on one of the engine projects for the 777. I would estimate fewer than 1 in 100 of the engineers working on the whole project had anything to do with ADA.
     
  19. May 21, 2007 #18

    chroot

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Great posts, caslav.ilic and AlephZero. You reiterated my main point against D H, which is that very little software in the entire field of engineering is actually high-reliability zero-defect flight software. It would not make sense to spend your time learning Ada, instead of something more general and more widely applicable like MATLAB or C++, unless you are 100% sure you will never pursue nor accept a job doing anything other than zero-defect flight software.

    Of all the possible languages, C++ is the one that young engineers are pretty much expected to know, so you might as well start with that one. Companies will look very highly upon any prospective employee who has gone beyond C++. MATLAB and Fortran are tools that will find applications in almost any kind of engineering position, so I'd pursue them next. (And, in all honestly, MATLAB is greatly preferred in industry.) General purpose languages like Python or Perl can probably come last.

    And, in the exceptionally unlikely event that you do end up doing Ada for a living, you can probably pick it up in a couple of weeks on the job.

    - Warren
     
    Last edited: May 21, 2007
  20. May 21, 2007 #19

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    Warren, why are you trying to argue with me? Your final point is right along the lines of what I said. Those who choose to specialize in Ada are significantly reducing their career options.

    I also agree that very little software is of the high-reliability sort. It costs so very much to produce (less than one line of code per programmer per hour) that these techniques can only be used for very special purposes (i.e., the actual flight software, plus direct test scaffolding and flight data generation software, both of which are often treated as flight software.) Lower risk software can be written with two or three orders of magnitude greater productivity.

    Because flight software is so expensive, organizations such as Boeing and Lockheed are moving away from programming directly in Ada (or whatever). The people who do the flight software development are more likely to be software engineers than aerospace engineers.

    BTW, it appears Penn State does have a software engineering curriculum, but only at its Erie campus.
     
  21. May 21, 2007 #20

    ranger

    User Avatar
    Gold Member

    Just echoing what was said before, you need to learn how to program. There is a specific art that one uses to approach and deal with problems as they appear in the programming world, regardless of language. Having said that, I would recommend a set of books that I keep very close - "The Art of Computer Programming" by Donald E. Knuth. There are currently three completed volumes (the fourth is mostly available and the fifth is in preparation). Have a look at the author's website. The box set has a rather hefty price tag, but its definitely the book(s) to have if you're serious about programming.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Programming language for engineering
Loading...