Go to Post - Just because you can buy 50 giant pixie stix with your roommates Sam's club membership does not mean you should eat them all at once. - Not2B [more]
Home
Go Back   Chief Delphi > Technical > Programming > Python
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 05-05-2015, 07:40
mistersands mistersands is offline
Registered User
FRC #4528 (Automatons)
Team Role: Coach
 
Join Date: Aug 2013
Rookie Year: 2013
Location: NYC
Posts: 26
mistersands has a spectacular aura aboutmistersands has a spectacular aura aboutmistersands has a spectacular aura about
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?
Reply With Quote
  #2   Spotlight this post!  
Unread 05-05-2015, 08:27
MrRoboSteve MrRoboSteve is offline
Mentor
AKA: Steve Peterson
FRC #3081 (Kennedy RoboEagles)
Team Role: Mentor
 
Join Date: Mar 2012
Rookie Year: 2011
Location: Bloomington, MN
Posts: 573
MrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond repute
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.
__________________
2016-17 events: 10000 Lakes Regional, Northern Lights Regional, FTC Burnsville Qualifying Tournament

2011 - present · FRC 3081 Kennedy RoboEagles mentor
2013 - present · event volunteer at 10000 Lakes Regional, Northern Lights Regional, North Star Regional, Lake Superior Regional, Minnesota State Tournament, PNW District 4 Glacier Peak, MN FTC, CMP
http://twitter.com/MrRoboSteve · www.linkedin.com/in/speterson
Reply With Quote
  #3   Spotlight this post!  
Unread 05-05-2015, 12:05
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,043
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: Advantages of Python over Java?

Pro: RobotPy has a simulator you can use to test your code off robot
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
Reply With Quote
  #4   Spotlight this post!  
Unread 05-05-2015, 12:14
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,715
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Advantages of Python over Java?

Quote:
Originally Posted by MrRoboSteve View Post
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.
I agree with all of Steve's points here.
Reply With Quote
  #5   Spotlight this post!  
Unread 07-08-2015, 17:52
SamcFuchs's Avatar
SamcFuchs SamcFuchs is offline
Programmer
AKA: Sam Fuchs
FRC #0236 (TechnoTicks)
Team Role: Programmer
 
Join Date: Aug 2015
Rookie Year: 2014
Location: Old Lyme, Connecticut
Posts: 58
SamcFuchs has much to be proud ofSamcFuchs has much to be proud ofSamcFuchs has much to be proud ofSamcFuchs has much to be proud ofSamcFuchs has much to be proud ofSamcFuchs has much to be proud ofSamcFuchs has much to be proud ofSamcFuchs has much to be proud of
The lack of documentation and support would definitely worry me. However, if you are confident you can do it, go ahead.
__________________
Sam Fuchs
236 TechnoTicks, Old Lyme, CT

2015 - Programming, Electrical
2016 - Lead Programmer, Co-Driver
2017 - Lead Programmer, Co-Driver
Reply With Quote
  #6   Spotlight this post!  
Unread 07-08-2015, 18:27
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,076
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
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.
Reply With Quote
  #7   Spotlight this post!  
Unread 08-08-2015, 20:45
x86_4819's Avatar
x86_4819 x86_4819 is offline
computer-whisperer
AKA: Christian Balcom
FRC #4819 (Flat Mountain Mechanics)
Team Role: Programmer
 
Join Date: Sep 2014
Rookie Year: 2013
Location: Shepherd MI
Posts: 92
x86_4819 is on a distinguished road
Re: Advantages of Python over Java?

Quote:
You don't want to sit dead for half a match because of a typo.
Although I would generally agree with this, python actually helped my team out of a situation like this.

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.
__________________




My Github Repositories
Reply With Quote
  #8   Spotlight this post!  
Unread 08-08-2015, 21:42
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,043
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: Advantages of Python over Java?

Quote:
Originally Posted by x86_4819 View Post
Although I would generally agree with this, python actually helped my team out of a situation like this.

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.
That's fantastic.

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.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
Reply With Quote
  #9   Spotlight this post!  
Unread 08-08-2015, 23:08
Jared's Avatar
Jared Jared is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Aug 2013
Rookie Year: 2012
Location: Connecticut
Posts: 602
Jared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond reputeJared has a reputation beyond repute
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.
Reply With Quote
  #10   Spotlight this post!  
Unread 08-08-2015, 23:14
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,043
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: Advantages of Python over Java?

Quote:
Originally Posted by Jared View Post
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.
The good thing about python in FRC is that the underlying library you interact with to control the robot is almost exactly the same -- and generally speaking, the things that I've found teams have problems with in python tend to be the same things that people have in *any* language -- how to control a motor, state machine concepts, not using sleep() in your autonomous mode, don't overuse network tables... etc. And the good news is, if you ask others around you in terms of those concepts, they should be able to answer your questions regardless of which language you're using.

But you're right, python isn't for everyone.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
Reply With Quote
  #11   Spotlight this post!  
Unread 16-11-2015, 17:30
spat's Avatar
spat spat is offline
QDriverStation Developer
AKA: Alex Spataru
FRC #3794 (WinT)
Team Role: College Student
 
Join Date: Sep 2015
Rookie Year: 2013
Location: Mexico
Posts: 44
spat is on a distinguished road
Re: Advantages of Python over Java?

Quote:
Originally Posted by x86_4819 View Post
Although I would generally agree with this, python actually helped my team out of a situation like this.

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.
I can relate to you, re-compiling and deploying your robot code seconds before a match is really stressful, especially with LabVIEW running on a low-end computer

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.
Reply With Quote
  #12   Spotlight this post!  
Unread 16-11-2015, 18:35
Jellypickles234's Avatar
Jellypickles234 Jellypickles234 is offline
"Not another constraint error..."
AKA: Dean Schmidt
FRC #0234 (234 Cyber Blue)
Team Role: CAD
 
Join Date: Nov 2015
Rookie Year: 2015
Location: Indianapolis
Posts: 6
Jellypickles234 is on a distinguished road
Re: Advantages of Python over Java?

Quote:
Originally Posted by mistersands View Post
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?
Codecademy also has a new Java course, so if everyone is learning I would go solely off which program is preferred.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 06:24.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi