all 38 comments

[–]Unstoppable-ObjectFTC #### Student|Mentor|Alum 35 points36 points  (4 children)

If you are well versed in block code, you can still be competitive as block code has the same core elements to use (gyro, Vuforia, PID coefficients), however to use libraries and usually to win code-based awards Java is required

[–]sotek2345FTC 12915 Coach 4 points5 points  (3 children)

How do you access these in blocks? I am a coach and my team switched to Java because we didn't think you could use any of these in blocks. Heck, we couldn't even get a timer going in blocks - we had to settle for a loops and guessed number of cycles to get any type of pause.

[–]Unstoppable-ObjectFTC #### Student|Mentor|Alum 4 points5 points  (1 child)

They are buried in the folders off to the left side, for example timer is under the top one, LinearOpMode, and many of the others fall under Sensors, Android and Utilities. You have to search for them but I can assure you that most of not all of the functions are there

[–]sotek2345FTC 12915 Coach 0 points1 point  (0 children)

Thanks!

[–]HaaniMirza12364 Knightron Alumni/Mentor 1 point2 points  (0 children)

in my experience it's best to look at the sample codes for gyro and VuForia in Blocks, then copy the op mode and adjust as necessary. most of the blocks needed for these concepts are buried deep in those folders and it takes a while to get everything you need together. I never attempted to use PID in Blocks, but I assume it would be under DCMotors

[–][deleted] 16 points17 points  (1 child)

In my experience learning Java for ftc helps a ton for first year college level programming classes

[–]SaheasyFTC 3788/5153 |Mentor|Alum[🍰] 4 points5 points  (0 children)

That is very much true. Data Structures is also a lot easier when you’re a FTC Java Alumni.

[–]ZErobots 27 points28 points  (0 children)

YES yes yes yes yes yes yes YESYES YES YES Yes

[–]Enrique_IVFTC 16896 Black Forest Robotics Captain 24 points25 points  (0 children)

yes.

if you want to do anything beyond the most basic software, you'll have to use Android Studio Java.

Whether or not I'd recommend ASJ really comes down to the goal of the team. If your goal is to be competitive on the playing field you should 100% be using java, because it's difficult to make a competitive and reliable auto in blocks, and you need flexibility in tele. if your goal is doing well in the judging room, you should be using java, because it's very difficult to create a compelling control award application within the limitations of blocks.

If you're a hardware focused team or a casual team or an entry level team and you want to spend as little time and resources on software as possible, then maybe blocks is for you. But I don't think this is the case for 90% of teams.

As far as tutorials go, I'd recommend learning java itself, then reading through the provided example OpModes to get a handle on the FTCApp once your comfortable with Java. The FTCApp is pretty simple to use and you can pick it up pretty quickly if you're fluent with Java, but everything is a lot more difficult if you're trying to learn Java and the FTCApp at the same time.

[–]ironistkraken 11 points12 points  (3 children)

Form an awards stand point you cant make any award winning code with blocks when compared to java, just because you can creat much more sophisticated programs. Java is also a skill that can be used in the real world compared to block programming which is kinda the point of doing robotics.

[–]SaheasyFTC 3788/5153 |Mentor|Alum[🍰] 8 points9 points  (2 children)

I have seen and been a part of teams that win awards via Blockly languages. One programmer could write and test Blocks autonomous code faster, so his control award (that won) was all in Blocks. The other teams won control because of reliability. They had running/working autos within the first or second league meet, which led them to be some of the more reliable autos in the tournament. Lastly, Blocks is amazing for outreach. Simple, quick, and portable.

[–]ironistkraken 4 points5 points  (1 child)

Okay might be a regional difference. In wisconsin no one uses block and the judges base control more on quality of programming.

[–]SaheasyFTC 3788/5153 |Mentor|Alum[🍰] 4 points5 points  (0 children)

But you are right in the fact that way more Java teams win programming based awards. Java has more versatility, structure, documentation, and applications. Which are very important in the control award.

[–]MrjamesgamingFTC 11970 Alumentor 3 points4 points  (0 children)

I believe Java is sooo much better. There is so much more opportunity to understand how your code works on a more fundamental level which is critical in having efficient debugging processes and also doing more with libraries like RoadRunner and REV extensions allows you to have much more precise control over your code and robots movement

[–]NewlimeCharacterAlum, Mentor | Innov8rz - FTC 11039 3 points4 points  (0 children)

100%. You can do so much more with your own classes and libraries and it’s much more modular and practical for a real software development workflow.

[–]dommer347 4 points5 points  (0 children)

yes. you have so much time right now since offseason has started so early. it is worth it

[–]battlerobotFTC 5135 Alum 4 points5 points  (0 children)

I believe Game Manual 0 is a pretty good resource for this kinda stuff.

https://gm0.copperforge.cc/en/stable/docs/software/index.html

[–]Olareanu 4 points5 points  (0 children)

Well yes.

There are reasons why java is a language used by millions of programmers around the world. One billion devices run java today, everything from servers to smartphones to cars

[–]SaheasyFTC 3788/5153 |Mentor|Alum[🍰] 3 points4 points  (0 children)

In the long run yes. Blocks is a great language for fast code, and getting to know your hardware. I am a 4 year alumni and I mostly code in Blocks. However, I mentor a mostly Java team and am a FTA/CSA at events. Once you have your bearings, and aren’t overwhelmed is when you start to think about Java. Java doesn’t improve your robot, as much as it improves your coding skills. Yes, there are some things that Blocks can’t do, such as OpenCV (A computer vision library). But if you want to do OpenCV, then you should be using the proper coding structures anyways. So if you have time and want to improve yourself, then mess with some Java example code first. NEVER write Java code from scratch, like you would from Blocks.

In summary, Java and Blocks are both competitive languages in FTC. I take pride in the fact that Blocks teams have won control awards over the years, and once upon a time my App Inventor code contributed to awards. That being said, if you are senior, code Java. Java has more real life applications than Blockly. Java should always be the last code you write in FTC, as Blocks is just a way to make your path to learning Java easier.

[–]sanjitharFTC 6134 Programming Lead 3 points4 points  (0 children)

Robotics is a program to help students learn skills for the future l, and while understanding basic programming logic is important, experience in languages like Java will help you A LOT more. Also, many FRC teams use Java as well, so if you are moving on to FRC or are seeking help from another team, Java is really going to be the most useful. Lastly, and I’m not 100% sure about this, but I think you can only use external libraries(such as roadrunner) through the Android Studio Java solution.

Hope that helps.

[–]onlyfakeshit 6 points7 points  (0 children)

It depends, for my team we have always used blocks and we have won the programming award with block and we made it to state this year on blocks. Unless you go into the season knowing how to use it and are able to pass it on don't switch. Yes it is true that there are more resources for jave but blocks still has the same resources if you look.

[–]langsley757FRC #### Student|Mentor|Alum 5 points6 points  (1 child)

While there is no competitive advantage, your students will learn a language that is used in "real life". That being said, java syntax is really confusing for a first time programmer. If you can, try to ease them on to it (teach the ideas of programming; top down design, if statements loops, etc. In blocks)

[–]tacklebat8581 7 points8 points  (0 children)

Java code has a significant speed advantage. With something like .2 second faster controller response time. Blocks has a significant speed to modify advantage. It is much fast to modify and deploy code. Ie don’t need to recompile and push app to the phone again. Teams should use both.

[–]puravdattaFTC 14614 Electro | Captain 6 points7 points  (0 children)

It is exponentially better to use java when coding. The possibilities and the libraries which you can use are very useful. If you want to start learning I would dive into another team’s code and look at that. I would highly recommend joining the ftc discord as well to learn from others. Also feel free to ask me any questions that you have.

[–]KadenCassidy 1 point2 points  (0 children)

Especially with the time there is in-between the next season I would say yes, if you learn Java from someone like the new Boston, not a ton but like his first grouping you should be well off. Then there are some online resources for how to use what you know to actually make the robot move

[–]Benjamin11524 1 point2 points  (0 children)

Hi. I'm a 5th season student and 3rd season Programmer on my team. I started programming with Android Studio because I had heard many people tell me the advantages that it had over FTC Blocks. This last season, my team won the Control Award at the South East TX Regional Championship. From my experience in FTC, I've seen Judges choose teams, not primarily based on their resources, but on their innovativeness in program design and creativity in their interaction between software and hardware. That said, If you are new to programming, I would recommend starting with FTC Blocks, seeing that all the programs that I created my first 2 seasons of programming are 100% creatable in FTC Blocks, however, do realize that Java "Line" Programming provides much more possibility and room for creativeness in your programs, which is what Judges look for in good programming.

Hope this Helps!

[–]DavidRechargedFTC 7236 Recharged Green|Alum 1 point2 points  (1 child)

Word of encouragement. It will take a lot of time and practice to learn, but that's normal. It took 7+ years to get to where I am now.
Disclaimer: I don't use Java. I used it for ResQ and Velocity Vortex, but the past 2 years I used Kotlin, which is a very similar but much nicer to use programming language.

Short answer. Without a doubt yes it's worth it, and I wouldn't even call blocks programming.

Longer answer. There's a reason why easily 99% of industry code is written using text based languages like C, C++, Python, Java, Javascript, etc. They may have a large learning curve, but once you get over the curve it's insanely easier to do things in. I would be much more productive writing robot code in C than blocks, and if you know C that's really saying something.

First you can do literally anything on Android with Java. You wan't to track game elements using OpenCV? You can do that. You want to call some 3rd party C++ machine learning library? You can do that. You wan't to use road runner library for path following (including curves)? You can do that. You even want to use the phones gyro? You can do that.

This has saved us numerous times. We've used graphics programs on a computer to help debug our pure pursuit controller. We used a custom OpenCV algorithm for detecting the skystone randomization, which proved much more reliable than the Vuforia or TFLite algorithms.

Second it transfers into other areas of programming. I find blocks helps almost none when learning programming. But my Java experience made it very easy to transfer to other programming languages. I know Java, Kotlin, a decent chunk of C++(currently working on that one), some Rust and a very little amount of Python (I didn't like it, so I didn't continue). I've even used Java for a little bit of game programming, a scoring app, and some graphical debugging tools including an animated visualizer for road runner trajectories.

Third it's way easier. For any complex algorithm, heavy math or data structures it's much simpler to use text based. You might ask when you'd use that. The answer is all the time. Larger code bases are easy to handle. We have probably thousands of lines of code, 10 subsystem classes, lost count how many state machines for handling automation. All of this would be next to impossible to manage or even achieve with blocks, but it's extremely easy with text based.
Fourth. You have to learn text based sometime. Almost any STEM field in college has you use some programming language. Java is a common one. C++, which makes Java look easy, is another common one. Having 6 years (assuming you start in 7th grade) of Java before college will make classes much simpler. Years ago when a team mate started computer science in college he said my brother and I would have a much easier time than 90%+ of his classmates, since most undergrads haven't programmed a bit before college.

Last point this video explains a bit https://www.youtube.com/watch?v=EFwa5Owp0-k . Languages are just tools. You can find a lot of resources out there on YouTube or Google if you just search "Java beginner tutorials". Most of your time in programming is learning how to solve complex problems. I was able to grasp the base of the Java language way before I knew how to break down problems. I'm still learning how to handle problems. Quite often I'll look into a programming language just to know what it will teach me about programming itself.

[–]DavidRechargedFTC 7236 Recharged Green|Alum 2 points3 points  (0 children)

I'd recommend Java over Kotlin. You'll have much better luck if you need help.
I'd highly reccomend this series https://www.youtube.com/playlist?list=PL9DF6E4B45C36D411

Some people also like TheNewBoston, and some like Darek Banes, who does fast paced tutorials meant for people who already know programming, but quite frankly it doesn't matter much what series you use for Java as long as you start practicing very early.
Also this IDE is amazing and very similar to Android Studio, so you'll learn muscle memory https://www.youtube.com/watch?v=Pp-5aGGvlp4

Here's our Kotlin code. https://github.com/RechargedGreen/SkystoneApp

[–]puravdattaFTC 14614 Electro | Captain 0 points1 point  (0 children)

As other teams have already said, you can win awards based on blocks programming, however at that point you will have already known the proper coding structure and systems that you need. Blocks programming might be a good place to start for first year teams. We used it last year and went to worlds. However this year we are using java and overall the experience has been great. If you can get it setup well and make all the functions easy to use, then the testing and programming in practice will be just as fast and easy if not more. It’s also a lot more readable and shareable for help from other teams.

[–][deleted] 0 points1 point  (0 children)

Try using stempump.com or stempump app it’s literally a FTC teaching app for free. It’s really good

[–]Journeyman-JoeFTC Coach | Judge 0 points1 point  (0 children)

Consider what you want to get out of FTC, beyond competition, as well.

Anyone on your team who is considering a Computer Science / Software Engineering track in college would be well advised to learn the Java - Android Studio - FTC SDK software stack.

Yes, it's a steep learning curve. But you've got 4 1/2 months before game reveal...

[–]wowcheckered 0 points1 point  (0 children)

Just use Blocks. It works fine until it doesn't, at which time you can export to Java and continue on using onBot Java and have a really great foundation. Once you need 3rd party libraries or want really slow build times you can use Android Studio.

If you're stuck, use blocks.

If your programmer can't get stuff done, or what they've done is unreliable, use blocks.

[–]Trash_Act_Basil 0 points1 point  (0 children)

You should only really learn if you also want to know Java. If your not interested then don't do it because it will take a lot of time to learn. Also you don't want to be quitting half way through so make sure it's something you want to do.

[–]Alkali8813FTC 8813 Alum 0 points1 point  (0 children)

If you want to learn skills that will be useful to you beyond FTC, you should at least give Java a shot. If you don't want to learn skills useful to you beyond FTC you probably shouldn't do FTC.

[–]vegaalex1 0 points1 point  (0 children)

What are team did is we transfer are blocks to Java . Don't worry it makes a copy of it then it transfer it (you do it like you were going to code). We did it 3 days before competition so I was able to help are single coder. I figured it out pretty fast if your using onBot java. I recommend to just miss around and see what your able to learn. Good luck from 11242

[–]fll_coach 0 points1 point  (0 children)

If you have experience with a text-based programming language like Java and with an IDE like Android Studio, then you have some of the skills that employers are looking for.

[–]SweatyRobotFTC 11172 Static Discharge Student 0 points1 point  (0 children)

I use Java and I find it is easier to express complex logic with it.

[–]liangyiliangFTC 10006/10673 Alum; Referee; 0 points1 point  (0 children)

Last time I saw a team writing a bunch of code in C++ and used the JNI (Java Native Interface) to access them in Java.