We create a new team for frc,which is better for frc programming java or python
Does your school teach AP Computer Science? If so, Java is likely your best shot.
In addition, check with your local mentor base. Are there lots of Java programming mentors available? If so, choose Java. Same for Python and even C++.
Additionally, if most of your programming team is already knowledgeable in one language, you’re most likely best off with that language.
Also consider that Java is used by over 3/4 of FRC teams. You will have much better software support from other teams if you use Java.
There’s no one-size-fits-all.
I would like to add that (from my experience) there are a lot more examples/guides for java than cpp.
Java just because so much community support.
So much community support … So far. Laughs in parseltounge /s
I think it also depends of the size of your team. If you won’t always have access to the robot I recommend using java or c++ because they have type safety so you will find issues with your code when you are writing it as opposed to on the robot.
I mean there’s full guides step by step on how to setup basic drive code for java & cpp and even full java examples with sims, instructions, & full internal docs, with lists of resources
What of those is python missing?
community support RobotPy isn’t that large and very few people are developing python modules and modules with cpp backends not built for FRC will doubtfully have an arm 32 bit version
By changing the subject without addressing the question, are you acknowledging that you were wrong, and Python has all of these?
Isn’t this true of any language? What FRC community projects provide JNI wrappers and roboRIO artifacts for non-FRC libraries. I can’t think of any off the top of my head.
I suspect that RobotPy has a much higher ratio of RobotPy developers to teams using it then Java WPILib developers, leading to issues fixed sooner.
With all that being said, I suspect that Java is the right choice for the majority of teams. But you don’t have to make up things that aren’t true about Python support in order to promote your preferred language.
Vim… no… wait… wrong holy war.
I worked with a rookie team this past year running Python and it was brilliant. The base driving examples were remarkably straight forward. Doing more advanced things was probably a touch more difficult than it would have been with Java BUT the students were able to get support on Discord with great success.
We did encounter a couple weird documentation things but worked to get those reported/resolved.
At this point… for a team that is brand new to FRC and doesn’t have an existing base of support to draw on for programming expertise, I’d recommend Python for them. It’s a solid choice and a real improvement to FRC to have it available.
We provide a build service for that at GitHub - robotpy/roborio-wheels: Builds Python wheels of non-RobotPy projects for RoboRIO, though it doesn’t work for every wheel.
That’s actually great to know. Thank you a ton. with robotPy going into wpilib is there a plan to include gradle support & are there any good ways to run CI\CD checks for it right now?
Pytest should be integrated so iirc python robot.py test starts tests.
Re Gradle: It doesn’t make a ton of sense for robotpy to depend on java to work.
that makes sense, I mean gradle didn’t really make sense for c++ but the unified architecture was nice.
As a software developer, my preferred programming language is Python, but my advice for a new FRC team is to go with Java. You’ll get more support, not only here on CD, but also at competitions from other teams and CSAs. Java also fits better with AP Computer Science. Maybe this will change in the future.
I would like to echo much of what has been said before.
- Choose whichever language your members and mentors know best
- Choose whichever has the tutorials your mentors and members understand best
- Python has less syntax to remember, but not every IDE handles a Python file the same (tabs and spaces conflict), so switching IDEs mid-project can become an issue (but as a rookie team, I highly recommend just using vscode for everything).
In our experience, there is another variable (which may be solved soon)
If all above is equal,
Python is more difficult for inexperienced software installers than Java because, currently, WPILib installs the entire environment in one install session. For Python, you do need to install Python on both the host computer as well as the Rio. These extra steps can be confusing for new teams if they are not experienced with installing environments.
If you are supporting students remotely, this adds a level of complexity to the initial meeting.
It also adds more complexity for 3rd party plugins and updates for the same reason.
However, install shenanigans aside, we had more members programming successfully independently with Python because they did not need to learn as much syntax.
WPILib actually doesn’t install everything at once. GradleRIO copies shared objects and some configs to the roboRIO during the first deploy. RobotPy does the same thing in addition to installing a Python runtime, but the latter is a separate step in the installation guide.
We’re working on including RobotPy in the main installer as well.
I think that Python is a much more intuitive introductory language, and it’s getting first class support for next year in WPILib.
Secondary, I also believe that programming students and mentors that are comfortable with Java, will be able to transition to Python very easily. So, irrespective of the AP computer science curriculum, I think Python makes more sense.
Those mentors and students will just be like me, their Python will have it’s own look to it. I’m a C developer, that learned Python. When I write Python, it looks closer to C than what a Pythonista may create, but it gets the job done.
Edit to add: I also just starting writing tutorial documentation for our next year’s students (we will have an entirely new software team next year) so starting from scratch, to getting what our typical Command-Based code looks like on a real robot (and the simulator) up and running in Python is really straight forward if you’re even basically familiar with the notion of python package dependencies.
whatever your students(at large) are more comfortable with, eg whatever your school teaches.