|
|
|
![]() |
|
|||||||
|
||||||||
| View Poll Results: Have you, or do you plan to use Python for Robot code? | |||
| Never used it before, and probably never will. |
|
17 | 58.62% |
| Used it in the past, but probably not this year. |
|
0 | 0% |
| Haven't used it before, but plan to this year. |
|
6 | 20.69% |
| Used it last year, and probably will use it again this year. |
|
5 | 17.24% |
| What is python? |
|
1 | 3.45% |
| Voters: 29. You may not vote on this poll | |||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#16
|
|||
|
|||
|
Re: Teams who have used or plan to use python for Robot Code
Just providing some additional datapoints we use in helping choosing a language for our team.
First to answer the OP question: We used the python port of network tables last year, and plan to use it again if available in 2015. We program the robot in Java, and Vision in C++. We teach our kids Java only because that is most likely the language they will be learning going to college, so we feel this gives them a leg up on the rest of applicants. After all, that is our primary mission. It is very important to make the distinction for your team: Are you a team who has mentors whom can teach the language and solve problems, or is your team student driven, and they which to follow a certain language. If the students are passionate about a certain language, try your best to accommodate that. My first language was C++ and assembly of a 8051. In terms of easy to learn: My opinion is that Java is a good first start language, especially for someone who hasn't programed before. The reason I say this is because Java is still a compiled language (technical it is 1/2 compiled and 1/2 interpreted), and the sytax it has is pretty easily identifiable in many other mainstream languages (C++/C# which are used extensively in industries today). For our specific use of Robotics because Java is a compiled language some errors can be identified at compile time, making code easier to debug, and faster to correct. There are still run-time errors that you can not get away from. Python is a scripting language and its syntax is very similar to other scripting languages like Matlab (which I use everyday at work) but is rather different than mainstream languages. I think it is easier to learn Python syntax after knowing Java, then trying to learn Java syntax after knowing python. I believe it is a lot easier to remove things from syntax, than to add them (like the necessity of brackets in Java, but the lack of them in python). (I also believe it is easier to learn Java after knowing C++, rather than trying to learn C++ after knowing Java, like dealing with destructors) Python, is not a compiled language, it is an interpreted language, so the only errors you find are that at run-time. In my opinion, and this is only my opinion, it is harder to program Robots because errors are caught much later in the process. Now, if FRC was a work assignment that I was doing on my own, my language of choice would be C++. This is because our task is an embedded application, and the C++ language gives the advanced user extreme control over execution, direct access to the operating system, and we get rid of any interpreter overhead by the java virtual machine. However, because our goal is to give our students experience in a language they are more likely to use in college and personal projects (mobile apps, etc.), our language of choice is Java. In the end, it doesn't really matter what language you choose, all can get the job done in FRC as we have seen over the years, choosing the language which best suits your team must come from some external reason. There is no right answer for FRC alone. However, one pro of python is that you can write the same application much quicker and with a lot fewer lines than its C++ or Java counter part. That's because python removes all the extraneous syntax. When coding advanced algorithms, I typically code them in matlab first (another scripting language), just to get the logic right and not have to worry about syntax of Java and C++. Python and Matlab has that "It just works" feeling when writing code. Once I have the algorithm set in the scripting language, I can convert it to Java or C++, its a much quicker and easier process. Also, python modules for scientific calcs blow Java and c++ libraries for similar purposes out of the water in my opinion in terms of availability and ease of use. Hope this helps, Kevin P.S I am fully aware there are modules which you can use to compile python first, but in my opinion, its a waste of the reason you use the python language. Let the python interpreter compile and interpret in real time, with the efficiencies built in, like it was meant to do. P.P.S Thank you to all that are working on the python FRC port. It is an invaluable resource, and without their efforts we wouldn't even be able to consider python an option. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|