Go to Post FIRST isnt about getting what you deserve, FIRST is about other people seeing potential in us - and giving us an opportunity that we could never have earned on our own - KenWittlief [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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-11-2009, 09:15 PM
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Learning to Program in Java

This is a great resource on learning how to program in Java. If your interested in learning this is a good place to start.

http://www.javapassion.com/javaintro/

If anyone else has any resources to share, I'm sure it would be helpful for teams considering Java as an option next year.
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
Reply With Quote
  #2   Spotlight this post!  
Unread 05-11-2009, 09:46 PM
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,069
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: Learning to Program in Java

Sun maintains a fantastic set of Java tutorials on their official web site.

http://java.sun.com/docs/books/tutorial/index.html

These tutorials, along with JavaDocs of the Java API, are pretty much the only resources you need to get going.
Reply With Quote
  #3   Spotlight this post!  
Unread 05-13-2009, 02:36 PM
derekwhite's Avatar
derekwhite derekwhite is offline
Java Virtual Machine Hacker
no team (FIRST@Oracle)
Team Role: Programmer
 
Join Date: May 2009
Rookie Year: 2009
Location: Burlington, MA
Posts: 127
derekwhite is on a distinguished road
Re: Learning to Program in Java

You can also try the robot emulator to test out the versions of Java and tools that will be available next year. Check out the "Get the emulator NOW" link at:
http://sunspotworld.com/frc
Reply With Quote
  #4   Spotlight this post!  
Unread 05-13-2009, 05:16 PM
bobwrit's Avatar
bobwrit bobwrit is offline
//No Comment
AKA: ...
FRC #1977 (Loveland High Robotics)
Team Role: Alumni
 
Join Date: Oct 2008
Rookie Year: 2008
Location: Somewhere
Posts: 298
bobwrit is just really nicebobwrit is just really nicebobwrit is just really nicebobwrit is just really nicebobwrit is just really nice
Re: Learning to Program in Java

Quote:
Originally Posted by Jared341 View Post
Sun maintains a fantastic set of Java tutorials on their official web site.

http://java.sun.com/docs/books/tutorial/index.html

These tutorials, along with JavaDocs of the Java API, are pretty much the only resources you need to get going.
Seconded.




I also like the sam's 24 day series(or something like that) on Java.
__________________

FRC Team 1977 Alumni

Has Attended:2008 Colorado regional
2009 Colorado Kickoff
2009 Colorado Regional
2010 Colorado Kickoff
2010 Colorado Regional




The most exciting phrase to hear in science, the one that heralds new discoveries, is not "Eureka!"(I found it!), but rather, "Hmm.... That's funny" ---Isaac Asimov
Chance favors the prepared mind ---Louis Pasteur
And you can tell me, that I can't make a diffrence because I'm just one, but one is all it takes to start it. And you can tell me, that I can't change the world because I'm too young, but I wont stand here and be your target. ---FM Static
Reply With Quote
  #5   Spotlight this post!  
Unread 05-16-2009, 06:13 PM
brianelite brianelite is offline
Registered User
FRC #2898
 
Join Date: Feb 2009
Location: oregon
Posts: 36
brianelite has a spectacular aura aboutbrianelite has a spectacular aura aboutbrianelite has a spectacular aura about
Re: Learning to Program in Java

How hard is it to learn Java coming from C++?
__________________
Reply With Quote
  #6   Spotlight this post!  
Unread 05-16-2009, 08:57 PM
computerish computerish is offline
Registered User
FRC #0619
 
Join Date: Nov 2008
Location: va
Posts: 45
computerish is an unknown quantity at this point
Re: Learning to Program in Java

It ought to be fairly easy, since they are similar languages. I haven't done anything with Java for years, though, so I guess I'm about to find out.

Anyone know if we will be able to run whatever IDE they give us on Linux? All the software available now runs on Linux, so I am hoping whatever FIRST gives us will, too.

Last edited by computerish : 05-16-2009 at 08:59 PM.
Reply With Quote
  #7   Spotlight this post!  
Unread 05-19-2009, 12:35 AM
timothyb89 timothyb89 is offline
code monkey
FRC #1977 (Loveland High Robotics)
Team Role: Alumni
 
Join Date: Oct 2008
Rookie Year: 2009
Location: Loveland, Colorado
Posts: 45
timothyb89 will become famous soon enough
Re: Learning to Program in Java

Quote:
Originally Posted by computerish View Post
It ought to be fairly easy, since they are similar languages. I haven't done anything with Java for years, though, so I guess I'm about to find out.

Anyone know if we will be able to run whatever IDE they give us on Linux? All the software available now runs on Linux, so I am hoping whatever FIRST gives us will, too.
Its likely going to be NetBeans (which is awesome!), and that runs on Linux. The problem is that Eclipse does as well, and there definitely wasn't Linux support this year for C/C++ (I blame WindRiver).

Everything they use is probably going to come directly from the SunSPOT project, which is definitely cross platform. Even if FIRST doesn't provide the software for us, there's a good chance we'll be able to get it ourselves, assuming they don't brand it in some horrible way (i.e., the FIRST downloader).
Reply With Quote
  #8   Spotlight this post!  
Unread 05-19-2009, 07:11 AM
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,069
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: Learning to Program in Java

Quote:
Originally Posted by brianelite View Post
How hard is it to learn Java coming from C++?
In general, C++ -> Java is definitely easier than going in reverse. If you are good with C++ (and understand its underlying object oriented paradigm) you can pick up Java in a snap - it is both semantically and syntactically very similar.
Reply With Quote
  #9   Spotlight this post!  
Unread 06-02-2009, 01:13 PM
purduephotog purduephotog is offline
Active Defense Design Engineer
AKA: Jason
FRC #3015
Team Role: Leadership
 
Join Date: Jan 2007
Rookie Year: 2004
Location: Rochester, NY
Posts: 162
purduephotog is a jewel in the roughpurduephotog is a jewel in the roughpurduephotog is a jewel in the roughpurduephotog is a jewel in the rough
Send a message via AIM to purduephotog
Re: Learning to Program in Java

Quote:
Originally Posted by Jared341 View Post
In general, C++ -> Java is definitely easier than going in reverse. If you are good with C++ (and understand its underlying object oriented paradigm) you can pick up Java in a snap - it is both semantically and syntactically very similar.
Exactly.

I just finished working on a project where we 'ported' / rewrote large segments of code- brought it over from C++. I'd say 80% of it was copy/paste from C++ to Java with no problems. Yes, there were issues with some things (copy constructors, destructors, etc) but for the most part it was pretty simple.

The modern editor, assuming they give us netbeans to work in, will be a pleasure to work in compared to the older IDEs. I'll admit I know nothing about the graphical programming languages (heck I can't even remember the name of it)... but Java was fun to learn and use.
__________________
http://purduephotog.deviantart.com
Portrait Photography: "I used to say Immortalized in Silver, but now I say Captured and Squeezed by Electrons".
Reply With Quote
  #10   Spotlight this post!  
Unread 06-08-2009, 07:43 PM
ExarKun666's Avatar
ExarKun666 ExarKun666 is offline
Ben Error/MC Ben/NC Ben
AKA: Ben Kellogg
FRC #2429 (LCEC)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2008
Location: La Caņada, CA
Posts: 208
ExarKun666 is an unknown quantity at this point
Send a message via AIM to ExarKun666 Send a message via MSN to ExarKun666 Send a message via Yahoo to ExarKun666
Re: Learning to Program in Java

I came across a weird thought in this process. One of my teachers, who teaches C++ and Java, told me that when you program and compile Java Code [not to robot, but for animation for example], and when you compile C++ [not to robot, but for animation for example], and you execute them both, and if they did the same thing, all same except the syntax of course, that C++ does the compiling and executing a little faster then Java. First of all is this true for the robot, and if it is, what possible effects could it have?
__________________
Ben Kellogg




Team Sites: [LCEC Site] [FRC/FLL Site] [LCEC Blog]
Reply With Quote
  #11   Spotlight this post!  
Unread 06-09-2009, 07:23 AM
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,069
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: Learning to Program in Java

Quote:
Originally Posted by ExarKun666 View Post
I came across a weird thought in this process. One of my teachers, who teaches C++ and Java, told me that when you program and compile Java Code [not to robot, but for animation for example], and when you compile C++ [not to robot, but for animation for example], and you execute them both, and if they did the same thing, all same except the syntax of course, that C++ does the compiling and executing a little faster then Java. First of all is this true for the robot, and if it is, what possible effects could it have?
In general, C++ is faster. This is because C++ gets compiled into native machine code that can be directly executed by your processor. Java, on the other hand, gets compiled into an intermediate representation called byte code. The byte code is portable across all sorts of operating systems and processor types, but it must be interpreted into machine code at run time in order to execute. It is this interpretation step that generally makes Java run slower (although sometimes it can actually be a benefit with JIT compilation, but that's another issue). However, the Java Virtual Machine is constantly being improved and this performance gap is much smaller than it once was.

One other factor that has traditionally scared roboticists away from Java is garbage collection. In C/C++, memory is allocated and freed by the programmer directly. In Java, memory is periodically freed when needed (a process called garbage collection). While this makes a programmer's life much, much easier, it means that sometimes the system will decide to do garbage collection at an inopportune time, causing you to miss real time deadlines. However, once again there has been some advancement in this area that has turned this issue from show stopper to mere nuisance.

I don't think we'll see an enormous performance difference between Java and C++ on our cRIOs. Besides, most teams are only scratching the surface of what the cRIO can do. And good Java is both more robust and oftentimes faster than bad C++ - if a team isn't comfortable with C++, any code that they produce may well end up being faster in their Java implementation anyways.
Reply With Quote
  #12   Spotlight this post!  
Unread 06-09-2009, 06:07 PM
ExarKun666's Avatar
ExarKun666 ExarKun666 is offline
Ben Error/MC Ben/NC Ben
AKA: Ben Kellogg
FRC #2429 (LCEC)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2008
Location: La Caņada, CA
Posts: 208
ExarKun666 is an unknown quantity at this point
Send a message via AIM to ExarKun666 Send a message via MSN to ExarKun666 Send a message via Yahoo to ExarKun666
Re: Learning to Program in Java

Quote:
Originally Posted by Jared341 View Post
In general, C++ is faster. This is because C++ gets compiled into native machine code that can be directly executed by your processor. Java, on the other hand, gets compiled into an intermediate representation called byte code. The byte code is portable across all sorts of operating systems and processor types, but it must be interpreted into machine code at run time in order to execute. It is this interpretation step that generally makes Java run slower (although sometimes it can actually be a benefit with JIT compilation, but that's another issue). However, the Java Virtual Machine is constantly being improved and this performance gap is much smaller than it once was.

One other factor that has traditionally scared roboticists away from Java is garbage collection. In C/C++, memory is allocated and freed by the programmer directly. In Java, memory is periodically freed when needed (a process called garbage collection). While this makes a programmer's life much, much easier, it means that sometimes the system will decide to do garbage collection at an inopportune time, causing you to miss real time deadlines. However, once again there has been some advancement in this area that has turned this issue from show stopper to mere nuisance.

I don't think we'll see an enormous performance difference between Java and C++ on our cRIOs. Besides, most teams are only scratching the surface of what the cRIO can do. And good Java is both more robust and oftentimes faster than bad C++ - if a team isn't comfortable with C++, any code that they produce may well end up being faster in their Java implementation anyways.
So out of the languages allowed: C/C++, LabVIEW, and Java, there is not a real big difference that would effect the performance of the cRIO, or robot operations?
__________________
Ben Kellogg




Team Sites: [LCEC Site] [FRC/FLL Site] [LCEC Blog]
Reply With Quote
  #13   Spotlight this post!  
Unread 06-09-2009, 09:19 PM
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Learning to Program in Java

There will be a difference, but since much of the heavy lifting is done by the FPGA, the differences will often not show up. Also since another expensive element, vision, is being done by an optimized binary library written in C, the differences again will not show up.

Raw arithmetic for control or other processing carried out on the cRIO will show the differences, and I'm as eager as anyone to see how they compare. LV is a compiled language, not a VM, but a good VM can beat a bad compiler. As with most engineering tasks, it will be a system of tradeoffs where performance is not the only thing to be concerned with. The ability to debug well and quickly modify code may be more important than the runtime performance.

Greg McKaskle
Reply With Quote
  #14   Spotlight this post!  
Unread 06-10-2009, 01:06 PM
purduephotog purduephotog is offline
Active Defense Design Engineer
AKA: Jason
FRC #3015
Team Role: Leadership
 
Join Date: Jan 2007
Rookie Year: 2004
Location: Rochester, NY
Posts: 162
purduephotog is a jewel in the roughpurduephotog is a jewel in the roughpurduephotog is a jewel in the roughpurduephotog is a jewel in the rough
Send a message via AIM to purduephotog
Re: Learning to Program in Java

I once was designing a program to perform several million iterations and distance calculations. I worried constantly about memory and time. When it was run in java it executed in just under 1 second.

1 second.

I gave up on the differences between C++ and Java at that point.
__________________
http://purduephotog.deviantart.com
Portrait Photography: "I used to say Immortalized in Silver, but now I say Captured and Squeezed by Electrons".
Reply With Quote
  #15   Spotlight this post!  
Unread 08-12-2009, 06:01 PM
JohnFogarty's Avatar
JohnFogarty JohnFogarty is offline
FTC, I have returned.
AKA: @doctorfogarty @GarnetSq
FTC #11444 (Garnet Squadron)
Team Role: Mentor
 
Join Date: Aug 2009
Rookie Year: 2006
Location: SC
Posts: 1,555
JohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond reputeJohnFogarty has a reputation beyond repute
Re: Learning to Program in Java

What i'm hoping is the software will run on windows 7
__________________
John Fogarty
2010 FTC World Championship Winner & 2013-2014 FRC Orlando Regional Winner
"Head Bot Coach" FRC Team 4901 Garnet Squadron

Former Student & Mentor FLL 1102, FTC 1102 & FTC 3864, FRC 1102, FRC 1772, FRC 5632
2013 FTC World Championship Guest Speaker
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Canera Calibration- Java program itsme Programming 1 01-20-2007 04:14 PM
Robocode: Learning JAVA the fun way. While fighting with robots. Denalin Fusion Chit-Chat 2 09-26-2005 11:22 PM
java to pbasic nzj1 Programming 11 01-09-2003 07:24 PM
Java Books Yan Wang Programming 1 12-27-2002 04:26 PM
No Java for XP Kyle Fenton Chit-Chat 21 07-23-2001 08:15 PM


All times are GMT -5. The time now is 07:35 AM.

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