|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Advantages of Python over Java?
So my team has been coding in Java but my head coder is graduating and there isn't a clear replacement. I tend to double as the coding mentor as we have no one else, so I basically have taught myself.
Python gets a lot of buzz as easy to learn. And there is the www.codecademy.com course which makes it easy to have my students learn the basics of the language. My question is, do you think it is worth switching? So far my Pro/Cons list Pros: -Can point students to www.codecademy.com course. -Simpler for new coders to learn Cons: -Not as well supported in FRC Any thing else I should consider? |
|
#2
|
|||
|
|||
|
Re: Advantages of Python over Java?
When teams ask me which programming language to use, my first answer is "the one your mentor knows how to program."
Teams without a strong programming mentor, in nearly all cases, should stick with one of the three officially supported languages. Why? For the sort of programming most teams do, there's no material difference in difficulty between those languages and Python. There is a much larger support ecosystem online for the supported languages. You can ask other teams for help with the supported languages. Most events have CSAs who know the supported languages. I wholeheartedly support the teams that have brought additional language support to the FRC world. Those teams also have the people infrastructure to be independent. |
|
#3
|
||||
|
||||
|
Re: Advantages of Python over Java?
Pro: RobotPy has a simulator you can use to test your code off robot
|
|
#4
|
|||||
|
|||||
|
Re: Advantages of Python over Java?
Quote:
|
|
#5
|
||||
|
||||
|
The lack of documentation and support would definitely worry me. However, if you are confident you can do it, go ahead.
|
|
#6
|
|||||
|
|||||
|
Re: Advantages of Python over Java?
Python is a great scripting language, but using any interpreted language in a production system (e.g. on the field in FRC) requires LOTS of care. You don't want to sit dead for half a match because of a typo.
|
|
#7
|
||||
|
||||
|
Re: Advantages of Python over Java?
Quote:
At my team's first competition, I had made some last-minute tweaks to the robot's drive code right before we left for a practice match. Autonomous runs, then I grab the joystick for teleop only to find my drive controls accelerated and inverted. Not from a syntax error, but a missing "-" and an extra "0" in the perfectly-valid python code. However, because I was using python, it only took about 30 seconds (mid-match) for me to ssh into the robot, modify the offending file, and re-load the code in order for us to continue practicing. |
|
#8
|
||||
|
||||
|
Re: Advantages of Python over Java?
Quote:
![]() Python definitely is very good for quick iteration -- though, I think the roborio has made redeployment of all code a lot easier. There's definitely a lot of risk when using interpreted languages, but a lot of that risk can be mitigated by things like writing unit tests, using simulators, and the like -- which really, we should be teaching our students how to do that stuff anyways. This is why I've made sure that RobotPy has first-class support for unit testing and simulation. I've been using Python on robots since 2011, and teams I've worked with have never had a robot die in a match because of a syntax error. |
|
#9
|
||||
|
||||
|
Re: Advantages of Python over Java?
I would pick Java over Python, especially if many of your programmers are learning.
When things go wrong (they will!), many people will be able to help you with Java. Few people will be able to help quickly with python. We only won an event this year because of the help with Java an FTA gave us between matches to fix our autonomous mode. |
|
#10
|
||||
|
||||
|
Re: Advantages of Python over Java?
Quote:
But you're right, python isn't for everyone. |
|
#11
|
||||
|
||||
|
Re: Advantages of Python over Java?
Quote:
![]() That was one of the primary reasons why I switched our team from LabVIEW to C++ (it compiles much faster than LabVIEW, and our programming team is more familiar with it) and (testing) Python. |
|
#12
|
||||
|
||||
|
Re: Advantages of Python over Java?
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|