Go to Post Don't be too distracted by the shiny robots, and the games they play. Enjoy them, but keep your eyes on the real prize(s). - gblake [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 17-05-2009, 23:54
The Lucas's Avatar
The Lucas The Lucas is offline
CaMOElot, it is a silly place
AKA: My First Name is really "The" (or Brian)
FRC #0365 (The Miracle Workerz); FRC#1495 (AGR); FRC#4342 (Demon)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Dela-Where?
Posts: 1,564
The Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond repute
Send a message via AIM to The Lucas
Re: **FIRST EMAIL**/Java and Orbit Balls

Quote:
Originally Posted by Alan Anderson View Post
I don't understand the point (!) of your example. What part of it should I focus on? None of it appears to show me a reason for preferring to use explicit pointers.
I generated assembly for both of the examples with the relevant instructions bolded

Quote:
Originally Posted by Chris27 View Post
Code:
 1 #include <stdlib.h>
 2 
 3 int main()
 4 {
 5   int *array = malloc(10 * sizeof(int));
 6   int *ptr;
 7   int i;
 8 
 9   for(i = 0; i < 10; i++)
10     ptr = array + i;
11 
12   return 0;
13 }

Code:
.L2:
        cmpl    $9, -12(%ebp)
        jg      .L3
        movl    -12(%ebp), %eax
        sall    $2, %eax
        addl    -4(%ebp), %eax
        movl    %eax, -8(%ebp)
        leal    -12(%ebp), %eax
        incl    (%eax)
        jmp     .L2
.L3:
Quote:
Originally Posted by The Lucas View Post
Code:
 1 #include <stdlib.h>
 2 
 3 int main()
 4 {
 5   int *array = malloc(10 * sizeof(int));
 6   int *ptr = array;
 7   int i;
 8 
 9   for(i = 0; i < 10; i++)
10     ptr++;
11 
12   return 0;
13 }

Code:
.L2:
        cmpl    $9, -12(%ebp)
        jg      .L3
        leal    -8(%ebp), %eax
        addl    $4, (%eax)
        leal    -12(%ebp), %eax
        incl    (%eax)
        jmp     .L2
.L3:
So 4 instructions are necessary for ptr = array + i; and only 2 instructions for ptr++; in this assembly language.

Quote:
Originally Posted by Alan Anderson View Post
Isn't pass by reference exactly what Java lets you do in such cases? I guess I'm completely failing to understand what you're trying to explain here.
I Googled "java swap" and this site explains it pretty well. Basically when you pass by reference to a function in Java it gives the function a new (different) reference to the object and there is no way to change the original reference in the passing function. In C++, the pointer is like an absolute reference (memory location) that is the same everywhere and you can even use pointers to pointers (no references to references in Java).
__________________
Electrical & Programming Mentor ---Team #365 "The Miracle Workerz"
Programming Mentor ---Team #4342 "Demon Robotics"
Founding Mentor --- Team #1495 Avon Grove High School
2007 CMP Chairman's Award - Thanks to all MOE members (and others) past and present who made it a reality.
Robot Inspector
"I don't think I'm ever more ''aware'' than I am right after I burn my thumb with a soldering iron"

Last edited by The Lucas : 18-05-2009 at 00:00.
  #17   Spotlight this post!  
Unread 18-05-2009, 00:39
Chris27's Avatar
Chris27 Chris27 is offline
Registered User
AKA: Chris Freeman
FRC #1625 (Winnovation)
Team Role: Alumni
 
Join Date: Mar 2005
Rookie Year: 2004
Location: Mountain View
Posts: 196
Chris27 has a brilliant futureChris27 has a brilliant futureChris27 has a brilliant futureChris27 has a brilliant futureChris27 has a brilliant futureChris27 has a brilliant futureChris27 has a brilliant futureChris27 has a brilliant futureChris27 has a brilliant futureChris27 has a brilliant futureChris27 has a brilliant future
Re: **FIRST EMAIL**/Java and Orbit Balls

Quote:
Originally Posted by The Lucas;860118
So 4 instructions are necessary for [B
ptr = array + i;[/b] and only 2 instructions for ptr++; in this assembly language.
So what's your point? Of course an expression that contains multiple variables will generally be more complex then an expression that contains a single variable. ptr = (&(ptr[0])) + 1 will again compile to the same assembly. Array indexing is just an encapsulation for pointer arithmetic as I explained earlier. Any pointer arithmetic expression will have a matching array index expression and both of these expressions will compile to the exact same instructions.

Quote:
I Googled "java swap" and this site explains it pretty well. Basically when you pass by reference to a function in Java it gives the function a new (different) reference to the object and there is no way to change the original reference in the passing function. In C++, the pointer is like an absolute reference (memory location) that is the same everywhere and you can even use pointers to pointers (no references to references in Java).
If you want to change a reference to an object, just have the method return a new reference. If you want a series of references, just encapsulate the references in objects. If you absolutely need to have access to the virtual address of an object, then Java just isn't the right language for the job.

Here is swap with references:

Code:
public class MyInt {
	
	int data;
	public MyInt(int x)
	{
		this.data = x;
	}
	
	public static void swap(MyInt a, MyInt b)
	{
		a.data ^= b.data;
		b.data ^= a.data;
		a.data ^= b.data;
	}

}

Last edited by Chris27 : 18-05-2009 at 01:09.
  #18   Spotlight this post!  
Unread 18-05-2009, 03:05
The Lucas's Avatar
The Lucas The Lucas is offline
CaMOElot, it is a silly place
AKA: My First Name is really "The" (or Brian)
FRC #0365 (The Miracle Workerz); FRC#1495 (AGR); FRC#4342 (Demon)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Dela-Where?
Posts: 1,564
The Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond repute
Send a message via AIM to The Lucas
Re: **FIRST EMAIL**/Java and Orbit Balls

Quote:
Originally Posted by Chris27 View Post
ptr = (&(ptr[0])) + 1 will again compile to the same assembly.
You can't dereference (&) and do pointer arithmetic like that in Java.

Quote:
Originally Posted by Chris27 View Post
Array indexing is just an encapsulation for pointer arithmetic as I explained earlier. Any pointer arithmetic expression will have a matching array index expression and both of these expressions will compile to the exact same instructions.
There is no matching array index expression for this:

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:
Originally Posted by Chris27 View Post
If you want to change a reference to an object, just have the method return a new reference. If you want a series of references, just encapsulate the references in objects. If you absolutely need to have access to the virtual address of an object, then Java just isn't the right language for the job.

Here is swap with references:

Code:
public class MyInt {
	
	int data;
	public MyInt(int x)
	{
		this.data = x;
	}
	
	public static void swap(MyInt a, MyInt b)
	{
		a.data ^= b.data;
		b.data ^= a.data;
		a.data ^= b.data;
	}

}
I know you can create a new class, a similar example was on the page I linked. I just said it was simpler in C. Creating new classes or returning multiple references doesn't sound simple to me.

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
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.
__________________
Electrical & Programming Mentor ---Team #365 "The Miracle Workerz"
Programming Mentor ---Team #4342 "Demon Robotics"
Founding Mentor --- Team #1495 Avon Grove High School
2007 CMP Chairman's Award - Thanks to all MOE members (and others) past and present who made it a reality.
Robot Inspector
"I don't think I'm ever more ''aware'' than I am right after I burn my thumb with a soldering iron"

Last edited by The Lucas : 18-05-2009 at 12:23. Reason: oops quote fix
  #19   Spotlight this post!  
Unread 18-05-2009, 09:30
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: **FIRST EMAIL**/Java and Orbit Balls

Quote:
Originally Posted by The Lucas View Post
You can't dereference (&) and do pointer arithmetic like that in Java.
Right. The whole discussion here is based on the lack of pointer arithmetic in Java. But I'm still trying to find out why some think that pointer arithmetic is more efficient than using arrays. My understanding is that they compile to exactly the same thing, since in C a[i] is just syntactical sugar for *(a+i). I used to confuse people by writing i[a] instead, which gives exactly the same result.
Quote:
There is no matching array index expression for this:
Code:
ptr = 365;
Without significant context, I'm at a loss to understand why you'd want to write it. With the exception of using memory-mapped I/O, I have yet to see any examples anywhere where using absolute pointers gives any improvement in efficiency over using arrays.
  #20   Spotlight this post!  
Unread 18-05-2009, 10:24
Bharat Nain's Avatar
Bharat Nain Bharat Nain is offline
Registered User
no team
Team Role: Alumni
 
Join Date: Jan 2004
Rookie Year: 2003
Location: New York
Posts: 2,000
Bharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond reputeBharat Nain has a reputation beyond repute
Send a message via AIM to Bharat Nain Send a message via MSN to Bharat Nain
Re: **FIRST EMAIL**/Java and Orbit Balls

Quote:
Originally Posted by Alan Anderson View Post
Right. The whole discussion here is based on the lack of pointer arithmetic in Java. But I'm still trying to find out why some think that pointer arithmetic is more efficient than using arrays.

More importantly, how much does it matter in our application? What difference will it make?
__________________
-= Bharat Nain =-

Whatever you do, you need courage. Whatever course you decide upon, there is always someone to tell you that you are wrong. There are always difficulties arising that tempt you to believe your critics are right. To map out a course of action and follow it to an end requires some of the same courage that a soldier needs. Peace has its victories, but it takes brave men and women to win them. - Ralph Waldo Emerson
  #21   Spotlight this post!  
Unread 18-05-2009, 10:39
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,078
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: **FIRST EMAIL**/Java and Orbit Balls

Quote:
Originally Posted by Bharat Nain View Post
More importantly, how much does it matter in our application? What difference will it make?
Because if you don't use pointer arithmetic, you can't be a real programmer.

(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)
  #22   Spotlight this post!  
Unread 18-05-2009, 10:52
Greg Needel's Avatar Unsung FIRST Hero
Greg Needel Greg Needel is offline
REVving up for a new season
FRC #2848 (All-sparks)
Team Role: Engineer
 
Join Date: Jan 2002
Rookie Year: 2002
Location: Dallas, TX
Posts: 3,107
Greg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond reputeGreg Needel has a reputation beyond repute
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.
__________________
Greg Needel│www.robogreg.com
Co-founder REV Robotics LLC www.REVrobotics.com
2014 FRC World Champions with 254, 469, & 74
  #23   Spotlight this post!  
Unread 18-05-2009, 13:53
The Lucas's Avatar
The Lucas The Lucas is offline
CaMOElot, it is a silly place
AKA: My First Name is really "The" (or Brian)
FRC #0365 (The Miracle Workerz); FRC#1495 (AGR); FRC#4342 (Demon)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Dela-Where?
Posts: 1,564
The Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond repute
Send a message via AIM to The Lucas
Re: **FIRST EMAIL**/Java and Orbit Balls

Quote:
Originally Posted by Greg Needel View Post
I split this conversation into 2 threads into a java discussion and an orbit ball one.
Sorry for the extra work Greg but it was bound to happen.

Quote:
Originally Posted by Alan Anderson View Post
Right. The whole discussion here is based on the lack of pointer arithmetic in Java. But I'm still trying to find out why some think that pointer arithmetic is more efficient than using arrays.
It is clear I haven't been a targeting my statements well.

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:
Originally Posted by The Lucas View Post
So 4 instructions are necessary for ptr = array + i; and only 2 instructions for ptr++; in this assembly language.
Basically when stepping though an array, you can avoid a multiply(or shift left) op that is need to multiply the index variable by the sizeof that type by simply adding the sizeof to a pointer each time. Incrementing a pointer in a loop is the only pointer arithmetic that I regularly use and the ptr can be even be used as the loop control variable eliminating i.

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:
Originally Posted by Alan Anderson View Post
My understanding is that they compile to exactly the same thing, since in C a[i] is just syntactical sugar for *(a+i). I used to confuse people by writing i[a] instead, which gives exactly the same result.
Exactly all array indexing is pointer arithmetic. However, not all pointer arithmetic is array indexing. More on that next


Quote:
Originally Posted by Alan Anderson View Post
Without significant context, I'm at a loss to understand why you'd want to write it. With the exception of using memory-mapped I/O, I have yet to see any examples anywhere where using absolute pointers gives any improvement in efficiency over using arrays.
I accidentally stuck my explanation in the next Chris quote, I fixed it, this is how it should have read
Quote:
Originally Posted by The Lucas View Post
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.
As you said, memory map I/O is the only use I can think of for that expression. However, that wasn't even meant to be a practical example. It was just meant provide an simple example of pointer arithmetic that didn't have a matching array index expression to refute Chris' statement:

Quote:
Originally Posted by Chris27 View Post
Array indexing is just an encapsulation for pointer arithmetic as I explained earlier. Any pointer arithmetic expression will have a matching array index expression and both of these expressions will compile to the exact same instructions.

Quote:
Originally Posted by Jared341 View Post
Because if you don't use pointer arithmetic, you can't be a real programmer.

(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)
Great story
__________________
Electrical & Programming Mentor ---Team #365 "The Miracle Workerz"
Programming Mentor ---Team #4342 "Demon Robotics"
Founding Mentor --- Team #1495 Avon Grove High School
2007 CMP Chairman's Award - Thanks to all MOE members (and others) past and present who made it a reality.
Robot Inspector
"I don't think I'm ever more ''aware'' than I am right after I burn my thumb with a soldering iron"
  #24   Spotlight this post!  
Unread 18-05-2009, 14:30
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: **FIRST EMAIL**/Java and Orbit Balls

Quote:
Originally Posted by Bharat Nain View Post
More importantly, how much does it matter in our application? What difference will it make?
Bharat just won this thread.

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.
  #25   Spotlight this post!  
Unread 18-05-2009, 16:12
Foster Foster is offline
Engineering Program Management
VRC #8081 (STEMRobotics)
Team Role: Mentor
 
Join Date: Jul 2007
Rookie Year: 2005
Location: Delaware
Posts: 1,393
Foster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond reputeFoster has a reputation beyond repute
Re: **FIRST EMAIL**/Java and Orbit Balls *****JAVA DISCUSSION***

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.
Right. We now have CPU cycles and memory space to burn, so a cycle here and a cycle there does not make that much difference.

Quote:
So while you are all optimizing the instructions, I'll be working on what I want the code to do.
I get calls on a regular basis to "make it run faster." I always ask "Does it run correctly now?" since there is no reason to optimize a program that does not work.

Quote:
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.
There are two optimizations here. The custom language is focused to help solve motion control applications. C is a general purpose language, an electronic "hammer" so to speak.

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:
  • Improved VM processing - the actual runtime environment of the system
  • Improved "code generation" by the compiler
  • Improved library functions. By far the biggest speed pickups has been in the optimization of data structures in the system. Sorted lists are about 150% faster due to algorithm improvements (no longer the bumble sort) which then reflects back into the application.
You saw the same things with C and the IFI controller. You could roll your own code to do all the functions, but most of us took Kevin Watson's or the WPI library. Those key functions had been optimized first for "they work" then for "make them fast."

If you optimize the algorithm you seldom have to bit fiddle to make it faster.
__________________
Foster - VEX Delaware - 17 teams -- Chief Roboteer STEMRobotics.org
2010 - Mentor of the Year - VEX Clean Sweep World Championship
2006-2016, a decade of doing VEX, time really flies while having fun
Downingtown Area Robotics Web site and VEXMen Team Site come see what we can do for you.
  #26   Spotlight this post!  
Unread 18-05-2009, 23:46
Uberbots's Avatar
Uberbots Uberbots is offline
Mad Programmer
AKA: Billy Sisson
FRC #1124 (ÜberBots)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Avon
Posts: 739
Uberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond repute
Re: **FIRST EMAIL**/Java and Orbit Balls

Quote:
Originally Posted by Jared341 View Post
What is it that you want to do with pointers that Java's pass by reference system can't do exactly?
Before i answer this, wow what a discussion this simple pointer thing turned into.

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.
__________________
A few of my favorite numbers:
175 176 177 195 230 558 716 1024 1071 1592 1784 1816
RPI 2012
BREAKAWAY
  #27   Spotlight this post!  
Unread 19-05-2009, 05:38
Wetzel's Avatar
Wetzel Wetzel is offline
DC Robotics
FRC #2914 (Tiger Pride)
Team Role: Mentor
 
Join Date: Sep 2001
Rookie Year: 1999
Location: DC
Posts: 3,522
Wetzel has a reputation beyond reputeWetzel has a reputation beyond reputeWetzel has a reputation beyond reputeWetzel has a reputation beyond reputeWetzel has a reputation beyond reputeWetzel has a reputation beyond reputeWetzel has a reputation beyond reputeWetzel has a reputation beyond reputeWetzel has a reputation beyond reputeWetzel has a reputation beyond reputeWetzel has a reputation beyond repute
Send a message via AIM to Wetzel
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
__________________
Viva Olancho!
  #28   Spotlight this post!  
Unread 19-05-2009, 07:36
GeorgeTheEng's Avatar
GeorgeTheEng GeorgeTheEng is offline
Former Lord of the Vex
AKA: George Marchant
FRC #0087 (Red Devils)
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2000
Location: Mount Laurel, NJ
Posts: 166
GeorgeTheEng has much to be proud ofGeorgeTheEng has much to be proud ofGeorgeTheEng has much to be proud ofGeorgeTheEng has much to be proud ofGeorgeTheEng has much to be proud ofGeorgeTheEng has much to be proud ofGeorgeTheEng has much to be proud ofGeorgeTheEng has much to be proud ofGeorgeTheEng has much to be proud ofGeorgeTheEng has much to be proud of
Send a message via AIM to GeorgeTheEng
Re: **FIRST EMAIL**/Java and Orbit Balls

Quote:
Originally Posted by Uberbots View Post
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.
In my experience, when pointers are no longer part of the equation... There is a LOT less debugging that ever needs to be done. And the debugging that does need to be done is usually simplier. When code crashes there is a traceable route to it rather then having a line of code in a random unrelated location in a separate thread give unidentifiable errors in the code running at this moment.

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.
__________________
George Marchant - Lockheed Martin Engineer & General Nut Case
FIRST Credentials: Team 87 Mentor | Former Director FIRST Vex Challenge
NJ FIRST Planning Committee Member & NJ FVC Committee Member
Philadelphia Alliance Regional Corporate Advisory Board Member |
FRC and FTC volunteer at too many places to list (NJ, VA, DE, PA, NY, Championship)|


"Hi my name is George and I'm a FIRST-aholic. I've been a FIRST-aholic since 2000..."
  #29   Spotlight this post!  
Unread 19-05-2009, 10:37
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: **FIRST EMAIL**/Java and Orbit Balls *****JAVA DISCUSSION***

Quote:
Originally Posted by Uberbots View Post
I'm a C man. i need to know what is happening with my code at all times.
This is a truism. When you use C, particularly when you use pointers, you must have a constant deep understanding of exactly what your code is doing. A whole category of bugs is possible that only the programmer is capable of tracking down and dealing with.

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.
  #30   Spotlight this post!  
Unread 19-05-2009, 12:13
Uberbots's Avatar
Uberbots Uberbots is offline
Mad Programmer
AKA: Billy Sisson
FRC #1124 (ÜberBots)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Avon
Posts: 739
Uberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond repute
Re: **FIRST EMAIL**/Java and Orbit Balls *****JAVA DISCUSSION***

Quote:
Originally Posted by Alan Anderson View Post
When you use C, particularly when you use pointers, you must have a constant deep understanding of exactly what your code is doing.
And i do. So whats the problem?
__________________
A few of my favorite numbers:
175 176 177 195 230 558 716 1024 1071 1592 1784 1816
RPI 2012
BREAKAWAY
Closed Thread


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
**FIRST EMAIL**/Java and Orbit Balls *****Orbit Ball Discussion**** Pjohn1959 FIRST E-Mail Blast Archive 44 18-05-2009 20:19
"Java, Sun SPOT and the FIRST Robotics Competition" pogenwurst Programming 54 02-05-2009 23:37
Amazing Circuit Build and Simulation Java Applet Chris_Elston Electrical 2 26-06-2008 19:36
Eclipse Plugin, Linux, and a Java Loader shtylman Programming 5 17-01-2008 14:44
Learn C, C++, and Java with new board game. Elgin Clock Programming 8 04-11-2005 13:28


All times are GMT -5. The time now is 10:59.

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