Choosing a Programming Language

When writing any type of program, there will always be different ways to approach the problem. Namely, programs can be written in different programming languages. The same is true when writing programs for a FIRST Tech Challenge robot. FTC programs can be written in either the Blocks programming language or the Java programming language (using either the Android Studio tool or OnBot Java tool). Ultimately, the different FTC programming options each have their own benefits, and every team has different needs. Here are some descriptions and pros/cons of each option to help you decide what your team wants to use.

Blocks

“Blocks” is the simplest option for programming an FTC robot. Programs are constructed out of colorful blocks. These blocks are dragged and dropped from a toolbox to quickly create programs. Writing programs in Blocks is also easy to set up as you do not need to download any software onto the computer.  Instead, all you have to do is wirelessly connect a computer to your Robot Controller phone. This simple setup process is the same for OnBot Java, but not Android Studio.

Pros

  • Very easy for new teams and students, especially younger students
  • There is no reliance on a single computer
  • The Blocks format is similar to Scratch, another blocky programming language that students may have already been exposed to (through school, etc).
  • Code written in Blocks can be seamlessly converted to OnBot Java if the students decide that they want to move on to Java. All they have to do is click the “Export to Java” button, as shown in the image on the right.

Cons

  • Compared to Java, Blocks is not as good for preparing students for high school level robotics (FIRST Robotics Competition [FRC]). This is because in FRC many teams use Java or C++ (a line-based language similar to Java) to program their robots.

OnBot Java

OnBot Java is more difficult than Blocks, especially for new programmers. This is because OnBot Java uses the programming language called “Java”. Java is “line-based”, meaning that you use a keyboard to type lines of code in order to program your robot.

The process for setting up the OnBot Java development environment is the same as setting up the Blocks development environment. Once again, you do not have to download software to write code; rather, you simply connect your Robot Controller phone to your computer. Also like Blocks, OnBot Java programs are saved on the phone rather than the computer.

Pros

  • By learning Java, it is easier to expand one’s knowledge to other line-based programming languages such as C#, C++, Python, Javascript, etc.
  • Unlike Blocks, Java is a programming language that is used in the industry. So, by using Java in FRC, students are learning a programming language that can benefit them in high school, college, and the workplace.

Cons

  • Java is significantly more difficult to pick up for rookie programmers and younger students
  • It is more common for programmers to make errors with Java by typing something wrong, such as forgetting to put a “)” after a “(” or forgetting to put a “;” at the end of a line of code. These are called “syntax errors” and are not a concern when using Blocks.

Android Studio

Android Studio is similar to OnBot Java. Both tools use the Java programming language, and code created in either tool looks exactly the same. The factor that makes Android Studio different is the setup and use process. Unlike OnBot and Blocks, Android Studio requires you to download and set up the program onto your computer. Android Studio is an advanced tool used in the app development industry. Unlike the other two programming options, Android Studio requires a more complicated setup process. Also, it saves code on the computer rather than the Robot Controller phone.

Note: Personally, I do not recommend Android Studio for most teams. Although teams may be inclined to use it for its advanced features, its complicated nature can be very stressful for students. In addition, if a team wants to use Java, they can use OnBot Java instead of Android Studio; they will have the same experience without the complicated setup. In my opinion, Android Studio should mainly be used by teams with students that are experienced and confident in computer science. That is just my opinion; please choose at your team’s discretion.

Pros

  • Great for power users and experienced students
  • Provides a programming experience that is more similar to professional development

Cons

  • Difficult for students to get the hang of. Even if the mentors are comfortable with it, it is often important for the students to feel accustomed to their tool of choice.
  • Requires a more difficult setup process, yet still accomplishes similar results to OnBot Java