![]() |
**FIRST EMAIL**/Java and Orbit Balls
Greetings Teams:
In the 2010 season, FRC teams will have the option of programming their robot in Java. The addition of Java as a programming language option is the culmination of work by Worcester Polytechnic Institute (WPI) and researchers from the Sun SPOT project at Sun Microsystems Laboratories. To learn more as you wait for the 2010 season to begin visit [ http://www.sunspotworld.com/frc/Welcome.html ]http://www.sunspotworld.com/frc/Welcome.html and [ http://first.wpi.edu/FRC/frc-programming.html ]http://first.wpi.edu/FRC/frc-programming.html.$@# We’ll be updating both locations as details are finalized. If you are planning to hold an off season event or host a demonstration of your robot over the summer, you might want some extra game pieces. Used orbit balls (the ones that survived championship) are available for purchase starting today here [ http://logoloc.com/first/ ]http://logoloc.com/first/ Quantities are limited. If you are borrowing a FIRST field for your off season event, please remember that game pieces are not included in the loan. Go Teams! |
Re: **FIRST EMAIL**/Java and Orbit Balls
How much better is JAVA going to be than Lab view?
Is it easier to use? |
Re: **FIRST EMAIL**/Java and Orbit Balls
Quote:
For FRC robotics, I prefer LabVIEW. For my neural-networks research, Java was the clear choice. |
Re: **FIRST EMAIL**/Java and Orbit Balls
Yuck, java. The lack of pointers is a major turn-away for me.
However, for those high schools that offer AP computer science, the fact that the robot can now be programmed in java sorta bridges the learning gap a bit. |
Re: **FIRST EMAIL**/Java and Orbit Balls
Quote:
|
Re: **FIRST EMAIL**/Java and Orbit Balls
Quote:
|
Re: **FIRST EMAIL**/Java and Orbit Balls
Quote:
|
Re: **FIRST EMAIL**/Java and Orbit Balls
Quote:
Code:
char *ptr = malloc(SIZE); |
Re: **FIRST EMAIL**/Java and Orbit Balls
Quote:
I actually used a bit of pointer arithmetic this year to make a simple circular buffer for Camera Report Structures. Of course I could make a circular buffer class in Java too. Again, I am not recommending pointer arithmetic or saying it's vital, I am just saying it can be useful, simple and intuitive. My real concern with Java is not the pointer stuff but rather the runtime performance. Java uses just in time (JIT) compilation and garbage collection which should add additional (non deterministic) load to the programs run (of course I need to read more about how theses features are implemented). That being said, I think additional language options are a good thing and all of my programing students are taught Java (not C) in high school for the AP exam. |
Re: **FIRST EMAIL**/Java and Orbit Balls
Quote:
|
Re: **FIRST EMAIL**/Java and Orbit Balls
Quote:
|
Re: **FIRST EMAIL**/Java and Orbit Balls
Quote:
See, here is a small piece of code I just wrote. Code:
1 #include <stdlib.h>Code:
0000000000000000 <main>:Code:
1 #include <stdlib.h>Code:
0000000000000000 <main>:Absolutely no difference whatsoever. |
Re: **FIRST EMAIL**/Java and Orbit Balls
Quote:
|
Re: **FIRST EMAIL**/Java and Orbit Balls
Quote:
Quote:
Quote:
Code:
1 #include <stdlib.h>Plus explicit pointers make functions like swap (commonly used in bubblesort simple) simpler using C pass by reference. Again not vital, just something that gets abstracted away in a higher level language. |
Re: **FIRST EMAIL**/Java and Orbit Balls
Quote:
Quote:
|
Re: **FIRST EMAIL**/Java and Orbit Balls
Quote:
Quote:
Code:
.L2:Quote:
Code:
.L2:Quote:
|
Re: **FIRST EMAIL**/Java and Orbit Balls
Quote:
Quote:
Here is swap with references: Code:
public class MyInt { |
Re: **FIRST EMAIL**/Java and Orbit Balls
Quote:
Quote:
Code:
ptr = 365;Array indexing requires a symbol (base of array) and a type (size of element). When an integer can be cast to a pointer, pointer arithmetic can be done without an array. Quote:
Again, I understand both languages and the reasons why Java doesn't allow explicit pointers (source of bugs, reference counting for garbage collecting, sercurity, etc..). Lets revisit how this whole conversion happened (with me paraphrasing) Billy: Yuck Java. Pointers ftw :D Jared: What cant you do with Java references? Me: Pointer Arithmetic. Jared: Granted, but you better have a good reason. <Long posts involving example code by Chris, me and Alan> I thought twice before pressing Submit Reply on my first post because I knew it wouldn't be my last on this thread;) Programming debates are interesting (for me atleast) but time consuming. Maybe I should have just let Billy reply or learned from C++ vs LV threads. |
Re: **FIRST EMAIL**/Java and Orbit Balls
Quote:
Quote:
|
Re: **FIRST EMAIL**/Java and Orbit Balls
Quote:
More importantly, how much does it matter in our application? What difference will it make? |
Re: **FIRST EMAIL**/Java and Orbit Balls
Quote:
(I know that's not Brian's argument, but it is a good excuse to post one of my all time favorite programming urban legends) |
Re: **FIRST EMAIL**/Java and Orbit Balls *****JAVA DISCUSSION***
I split this conversation into 2 threads into a java discussion and an orbit ball one.
|
Re: **FIRST EMAIL**/Java and Orbit Balls
Quote:
Quote:
Alan, to show that pointer arithmetic can be more efficient than array indexing, I used ptr++ (cant use in Java) instead of array indexing in Chris' example loop. The generated assembly showed: Quote:
So basically I am saying (since my first post here) is pointer arithmetic (that can be done in C not Java) can be slightly more efficient in some situations. Nothing major that will make a significant difference in our robot code. Can we agree on that? Quote:
Quote:
Quote:
Quote:
Quote:
|
Re: **FIRST EMAIL**/Java and Orbit Balls
Quote:
An instruction cycle here or there makes zero difference in the face of the larger picture. If you want to have a truly useless argument, just remember that our new processor is pipelined AND has a double dispatch with multiple ALU elements. So while you are all optimizing the instructions, I'll be working on what I want the code to do. As a point of interest, I know someone who wrote his own graphical programming language that compiles to something that is on average twice as fast as C for embedded power and motion control applications. |
Re: **FIRST EMAIL**/Java and Orbit Balls *****JAVA DISCUSSION***
Quote:
Quote:
Quote:
The second is that there is most likely a set of libraries that he uses for the down and dirty interfaces. He optimized them to work with his target platform. Speed in Java the last few years has come from:
If you optimize the algorithm you seldom have to bit fiddle to make it faster. |
Re: **FIRST EMAIL**/Java and Orbit Balls
Quote:
Anyway, it just bothers me that java turns the idea of pointers from a more numerical approach to an object-oriented approach. I like knowing that the variable i am passing into a function is explicitly a pointer, not something determined by java. Its also bothersome that for primitive datatypes such as int's an entirely different datatype (Integer) is required if you want to pass it by reference into a function (i know there is a system to go around this but god knows how much overhead it incurs, along with the garbage collection of the implicit object). I'm a C man. i need to know what is happening with my code at all times. It helps (me) with debugging and low-level optimizing a lot. :] also: double/triple/quad/etc pointers. |
Re: **FIRST EMAIL**/Java and Orbit Balls *****JAVA DISCUSSION***
Our programming mentor is excited, because his AP classes use Java. It never hurts to give the school a really obvious reason why the time commitment is beneficial now.
Wetzel |
Re: **FIRST EMAIL**/Java and Orbit Balls
Quote:
Granted the rules with Java references can get odd at times as well. Honestly, working on a team where the school has no programming courses at all, I welcome being able to work with the kids using an industry standard language that does not involve having to address pointers and pointer arithmetic. Labview is not bad, but I see it as a niche product. C++ and Java have a much wider user base. |
Re: **FIRST EMAIL**/Java and Orbit Balls *****JAVA DISCUSSION***
Quote:
When you don't have the option of using pointers, you can usually trust that the compiler is keeping track of things for you appropriately. Debugging is a lot easier when your tools can show you how things are going wrong. |
Re: **FIRST EMAIL**/Java and Orbit Balls *****JAVA DISCUSSION***
Quote:
|
Re: **FIRST EMAIL**/Java and Orbit Balls *****JAVA DISCUSSION***
Quote:
This is one of many reasons why I would much rather do robot programming in Java, as very few high school students are experts in any language. |
Re: **FIRST EMAIL**/Java and Orbit Balls *****JAVA DISCUSSION***
Quote:
I still believe that its better to teach from the low level up to give the kids an understanding of why the segfault happens or what that mysterious null pointer was supposed to be, rather than being totally unaware of the problem at all. Then again, that may be too much for a 6 week FIRST season in which case i would agree that java (or labview) is the better option. |
Re: **FIRST EMAIL**/Java and Orbit Balls *****JAVA DISCUSSION***
Quote:
|
Re: **FIRST EMAIL**/Java and Orbit Balls *****JAVA DISCUSSION***
While it is great to have the programmers learn low level everything and get accustomed with all this, it is simply not as practical. There are those students who are very interested and will take the effort to learn it all during their 4 years in high school. Then there are those teams who can barely find a programmer and if someone can figure out how to write code in java, they can have a working robot. We have the options to suit the needs of different people and teams. You should also consider that there are those who will join a team in their senior year of high school and like programming in Java. Based on that, they will decide to take up CS/IT as their degree. Most students are clueless about their future coming out of high school. THAT is the point. We are not here to graduate engineers and scientists from high school. That's what college is for.
|
Re: **FIRST EMAIL**/Java and Orbit Balls *****JAVA DISCUSSION***
|
Re: **FIRST EMAIL**/Java and Orbit Balls *****JAVA DISCUSSION***
I have learned a lot about LabVIEW through FRC and through use with my Mindstorms NXT kit at home and I absolutely love it for many reasons that I don't want to write a 5000 character essay on. The other two programmers on my team gripe and complain and say it's "ok" and they still use it. They say it can't make games, do everything, and it's not something they're used to (one is an avid C programmer, the other has had experience with Java). I agree that LabVIEW seems to be designed for hardware interaction (exactly what we are doing) and not so much making software, but it does an extremely good job at it in my opinion.
But the one thing that we all agree on is that Java stinks. I haven't had much experience with programming as much as the other programmers on my team, but they say they've had bad experiences with Java, calling it "the worst programming language ever". From what they've told me, I can see where they're going. But I'd stick with LabVIEW no matter what, anyway. :) |
Re: **FIRST EMAIL**/Java and Orbit Balls *****JAVA DISCUSSION***
Quote:
I could start listing reasons as to why Java is a great alternative to C/C++ and LabVIEW, but most of those arguments have already been listed. From my own experience, Java is fun to write with, easy to debug (especially with a nice IDE), and is very versatile. Please don't come out bashing and making mindless statements, especially when they're based on inaccurate summaries and third-hand stories. I'd also suggest you try to write anything serious in assembly language before you bash Java as the "worst programming language ever." In the end it was loads of fun, and a great challenge, but oh what a pain :) (Note: I currently program in Java for a living, and have spent time in the past writing in C/C++, python, and have experimented with assembly and ruby) |
Re: **FIRST EMAIL**/Java and Orbit Balls *****JAVA DISCUSSION***
Someone gave me a "negative reputation mark" or whatever for my post above, and when I checked up on the thread, I saw that someone else had posted in complaint against my overly negative attitude towards Java. Well, even though this thread is old, I'd like to say I'm sorry and that you two are totally correct. I didn't mean to post a slam against Java, but I should have thought twice before posting that. Especially since Java is widely used and I don't even have much experience with it. All I know is what those other two programmers have told me, which is of Java's weak points and their bad experiences.
So sorry to anybody who thought I was being a snob; I sure had it coming, didn't I. |
| All times are GMT -5. The time now is 10:59. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi