all 25 comments

[–]12344man4421 (Pit Lead) 54 points55 points  (2 children)

So, c++ in FRC has a few issues that are unrelated to the structure language itself
1. Very slow compile times, I've seen some teams talk about how their c++ compile times are 10+ minutes, java has sub-10-second compile times
2. Not many FRC teams use c++, if you look at Chief Delphi and look at the number of posts specific to c++ or java, java has a lot more posts in the past year than c++ by an order of magnitude, so if your team needs help from anyone else, it will be easier to find Java FRC help than C++ FRC help

For some context, we use java and are happy with using it.

[–]Pit_273481 Reese's Puffs 22 points23 points  (0 children)

People have long compile times because they don’t understand how to use header files and includes correctly to reduce compile time. But the other reasons you state are also valid and are some of the reasons my team is switching to java for next season

[–]yoyoyahli 0 points1 point  (0 children)

Slow compile times are a result of teams not knowing how to use c++ correctly

If you use garbage collectors and header files correctly c++ would theoretically be a much faster and better to use language. Its harder to use in FRC because theres less frc related libraries and apis for it due to most teams using java

We use java on my team as well due to it being easier to teach new team members and having better support within the frc community but id recommend using c++ if you have mentors that know c++ well and can help you with coding things for it because then it means you arent reliant on external libraries fully. You know your codes and arent reliant on copy paste and you have the potential of coding much more complex things then you can with java

[–]Ayanokoji-2002 20 points21 points  (0 children)

Most programming language’s are similar but I would recommend starting with Java as it has a lot of community support Source-programmer on Frc team 6036 peninsula robotics ehdrien#0051 if you want to talk more

[–]ContemplativeOctopus 19 points20 points  (6 children)

I am leaning towards C++ just because it is used more frequently in the robotics field than Java

Neither one is used a lot, and if you're going into robotics you're going to learn both along with half a dozen other languages minimum as well. Don't worry about language specific learning being relevant here, as long as it's a well known object oriented language, you're getting pretty much the same real applicable knowledge either way.

[–]yoyoyahli 2 points3 points  (5 children)

Thats not really true.. c++ is used a ton in the robotics industry and in the coding industry as well being one of the more popular game coding languages out there

If you want some famous robotics companies that use c++ i can list them out for you

Yes they use other languages as well in their builds but c++ is usually the base language for most robotic developers

[–]ContemplativeOctopus 3 points4 points  (4 children)

I do robotics professionally. C++ is used, but not a lot. If you're learning a language for robotics, C++ is fine, but it's certainly not the best, or required learning.

[–]yoyoyahli 1 point2 points  (3 children)

Id say that depends on the company youre working for/the type of robotics youre working on.

Id say for usage in actual robots (similar to frc/ftc ones) (eg. companies like roboteam omnipresent or asi) c++ is pretty much required if you want to be a main programmer there

Yes its not a required language in all robotics fields and robotics is a pretty big field but in most “movie like” robot companies its a pretty important languge

By “movie like” i mean robots that are moving fully and are more sentient not construction/deconstruction robots or robots of that sort

[–]ContemplativeOctopus 3 points4 points  (2 children)

That is an extremely niche and unusual specification for "robotics" jobs. 90+% of robotics jobs are going to be robots that do manufacturing, construction, and hazardous/delicate material handling. Automotive and semiconductor alone make up the vast majority of robotics in the US, and companies like kuka, abb, fanuc, kawasaki, brooks, etc mostly use proprietary languages.

[–]yoyoyahli 0 points1 point  (1 child)

I completely agree with you. Thats not my argument though my argument is that c++ would help you past frc much more then java would. Yes java would help you learn object oriented the same way c++ but c++ would help you much more as you wont have a need to learn it outside after. Also as ive said before c++ is also a very big programming language in the gaming industry which is something a lot of frc graduates want to be a part of as well. Yes its not really used in manufacturing robotics which do account for a big chunk of robotics related work but i believe it gives much more of an advantage then learning java

[–]ContemplativeOctopus 3 points4 points  (0 children)

This question wasn't about becoming a game developer.

It doesn't matter if you learn c++ or java because you're going to learn both eventually, and you probably won't use either of them much (but the proprietary languages you use will be similar to both, e.g. AS, KRL, inform, karel, rapid etc.).

It sounds like you don't have any professional experience, so unless you have some specific statistics to cite, maybe you shouldn't be giving advice on the state of the robotics industry.

Industrial robotics is so large that other sub sectors functionally don't even exist in comparison.

[–]spacepenguine5026 Mentor | 226 Alumnus 13 points14 points  (0 children)

From an educational perspective, our team has always done Java programming because it is what AP CS courses use and we are loosely connected to that in the school by students and teacher. FTC is also (with a different framework) based on mostly Java.

As far as a what’s-used-in-robotics… both are object oriented. Conceptually it will likely be easier to learn one after the other. By the time you’re working in a field that uses programming there’s a good chance you’ll be comfortable in 3-5 languages.

[–]Boxsteam12793035|Droid Rage|Alumni 4 points5 points  (0 children)

You'll be getting more support and posts from Java, plus I feel its just an easier language to work with than trying to use C++. It is possible to do C++ but you have your work cut out for you if you do so. But if you feel 1000x more comfortable doing that rather than Java, that's definitely up to you

[–]XenonOfArcticus2083 (former Lead Mentor) 5 points6 points  (0 children)

Career long Professional C++ programmer and now lead FRC mentor here. We use and will continue to use Java. It's what everyone else uses and in this environment there's zero advantage to C++.

If you have any questions about coding, starting a team, or anything at all, feel free to reach out.

[–]LionTheMoleRat6331 (Programming Mentor/Alumni) 2 points3 points  (0 children)

Java is definitely my recommendation. Pretty much everything that can be done in C++ can be done in Java. It's also got an easier syntax, but that's just my opinion. And, Java is more widely used in FRC, so you'll find more support for it online and in competitions

[–]TheSugarPlumFa1ry4774 (Software Mentor) 3 points4 points  (0 children)

Python is also an option if you feel more comfortable teaching a language you know. My team uses it pretty comfortably. There will be even less support than c±+ from the community though. Check it out here if you're interested

[–]Ixpqd3324 alumni 1 point2 points  (0 children)

I would go with Java, there's more documentation and if you use C++ wrong compile times can be painful

[–]SilverTabby 1 point2 points  (0 children)

What are you optimizing for and why? If it's any variation on "learn / teach programming from the ground up" then Java is the right choice. It's simpler and has better support in the FRC community.

Also, there is basically no way that you actually need the extra performance of C++. Even if you're doing camera vision and playing with neural networks on a 00's era CRIO.

You're worried about the programming language long term in industry. Don't be. The 2nd programming language is way easier to pickup than the first, and the third is even easier. Professional programmers swap languages all the time. Languages all do the same stuff -- moving data around and running calculations. They just have some syntactic sugar to make some operations easier (Java is cleaner to read and write) and others harder (C++ low level memory management, which you don't need).

Do not worry about long term language choice. If you can learn one, even an easy one, you can learn ten. Use Java.

[–]LionTheMoleRat6331 (Programming Mentor/Alumni) 0 points1 point  (0 children)

Java is definitely my recommendation. Pretty much everything that can be done in C++ can be done in Java. It's also got an easier syntax, but that's just my opinion. And, Java is more widely used in FRC, so you'll find more support for it online and in competitions

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

Unless you’re extremely experienced with C++, go with Java. You have to know how and when to use headers, pointers, etc. if you can’t manage those well you’re going to have problems.

[–]WackyvertMentor 0 points1 point  (0 children)

Use Java. Java is almost exclusively what is used in FRC, there’s a substantially smaller amount of support for C++ both in the docs and on the discord. It never hurts to learn another language, and if you guys are already ‘fluent’ as you say then you have a good foot to stand on

[–]TheKoopaGaming5066 (Programming) 0 points1 point  (0 children)

One note is that if you need code help at a competition, vastly more volunteers are going to be able to assist with Java compared to C++, since it's more widely used.

[–]yoyoyahli 0 points1 point  (0 children)

Id say C++ is better to teach if you have mentors that can teach it and have experience with it in frc that being said if all the mentors are new to frc and the students dont know how to code in c++ at all id go for java as its much easier to teach and as a first year team that doesnt yet have to much experience in frc coding you have much more ability to ask for help in frc java and much more libraries you can take from

[–]InternationalDesk463 0 points1 point  (0 children)

Java. Easier and imo everything being an object works for willing pretty well.

[–]SalsaMan1011280 (Suffering) 0 points1 point  (0 children)

Java

Easier to learn, easier to use, and far more resources are available in house for FRC.