FRC supports several different programming languages:
C++
Java
LabVIEW
Python (Unofficial)
Each of these languages comes with their own advantages and disadvantages. Each team in FRC has to weigh these advantages and decide for themselves which languages makes the most sense. Team 4060 has utilized all of the officially supported languages in different seasons, based on what made the most sense at the time.
The following descriptions are based on the desriptions in FRC Programming 101.
Java is a textual language that is commonly taught at high schools and used for the AP CS exams. It is a “safe” language in that runs in its own virtual environment. While it doesn’t generally affect FIRST Robotics Competition, this virtual environment, also known as the JVM, means that Java programs are noticeably slower than compiled languages when used for computationally intensive tasks. Java is often selected because of its ease of use, and cross-compatibility.
Advantages:
Widely used by FRC teams, making finding FRC-specific resources and help easier
Harder to write code which will crash the robot application
Already used in some other educational settings, which might make student adoption easier
Text-based code is easy to store in source code control systems, such as git/GitHub
Disadvantages:
Although ubiquitous in some industries, Java is likely a fading language in many others, with preference moving to C# and Python
Code may execute slower than C++, but this is most likely not a significant issue in most cases
C++ is a fast textual programming language. It is used in industry for real time systems because of its power and efficiency, but the learning curve is much steeper than Java. C++ evolved from the C programming language and the mixture of historical and modern features sometimes lead to confusing syntax and/or unexpected behaviors. FIRST Robotics Competition teams primarily use it due to its speed, flexibility, and its extensive mathematical libraries.
Advantages:
Used widely in industry, can sometimes be more familiar to mentors
Can generates the fastest running code, depending on how the robot program is written
Text-based code is easy to store in source code control systems, such as git/GitHub
Disadvantages:
Much more difficult to learn than other languages, although FRC libraries hide some of this complexity
Easier to write code which will crash the robot application
More difficult to find assistance at FRC meets, as most teams do not use C++
LabVIEW is a graphical dataflow programming language developed by National Instruments (NI) for use by engineers and technicians. The LEGO WeDo and Mindstorms languages used for FIRST LEGO League Jr and FIRST LEGO League are derivatives of LabVIEW; so students coming from those programs may find it familiar. In a LabVIEW diagram, it is very easy to take advantage of advanced computing features, such as running pieces of code in parallel. While powerful, such features often introduce new issues to deal with. NI provides extensive debugging tools, however. The LabVIEW environment and language come with its own learning curve and unique challenges. FIRST Robotics Competition teams primarily use it due to its simplified graphical syntax and extensive engineering.
Advantages:
Graphical environment often has the simplest "Getting Started" experience.
Language capabilities and libraries are easily discoverable, from a graphical palette of available options.
Graphical data-flow programming may be more intuitive for some users.
Text-based code is easy to store in source code control systems, such as git/GitHub
Disadvantages:
Binary file format is difficult to use in source code control systems, such as git/GitHub
Not widely used by PNW FRC teams, making it more difficult to find help at meets
Deploying changes to the robot is slower that from text-based languages
Python is not officially supported for use in FRC, but unofficial support is available through the RobotPy project, with hopes to make it officially supported in future seasons.
Python is an interpreted language. In simple terms this means that the actual text-based code is on the robot, and it is translated into executable computer instructions as it is used. This does introduce inefficiency, but also enables unique workflows such as editing code to test changes without the need to compile and redeploy the code to the robot.
Advantages:
TODO
Disadvantages:
Not officially supported by FIRST