|
Re: PROGRAMMERS: WIND RIVER C++ vs LABVIEW vs JAVA
At the risk of offending the C/C++ faithful, I'll come right out and say: Java is better than C++ for this kind of work. Not a LOT better, because the languages are more alike than different, but there are a few important differences, and these by and large favor Java:
1) The plurality of errors (and debugging time) in any significant sized C/C++ programming project are always around memory management. There are still ways to make MM mistakes with Java, but the "bread and butter" MM work that used to be the application's responsibility in older systems is taken care of for you by the Java runtime. This is important at all levels of programming skill and experience.
2) Concurrency (i.e. threads or tasks) is a first-class part of the Java language rather than an add-on as with C/C++ based systems. This means if you learned how to write Java threads in a class, from a programming book, or on another platform, your knowledge comes with you to the cRIO. Concurrent execution will be part of the picture in any reasonably sophisticated FIRST robot. It's inherently tricky, but with Java it's easier to do and easier to get right.
The theoretical "performance advantage" of C/C++ is largely myth/illusion. There are some VERY narrow situations in which it still applies, but Java compiler technology is quite good, and the compiler's runtime awareness gives it some performance advantages, too. The chances that your situation is one where C/C++ has a performance edge are quite small; the chances your situation is one where a Java program is more likely to be correct are much larger.
I speak as an expert with many years' professional programming experience in both languages. Java is simply a more evolved programming system (it's not just the language, the runtime system is part of the picture too).
One caveat is that the implementation quality of a system matters too. Even if Java is "better" as I've argued, a good C/C++ system may end up better than a poorly implemented Java. Having worked with C++/WR last year and Java this year in FIRST, both seem fine here.
If you want to leverage existing C/C++ expertise and don't want to fool with Java, go for it, and you'll do fine. If you're starting from square one, I highly recommend Java over C/C++.
|