To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 25325
25324  |  25326
Subject: 
Why Java for Robots
Newsgroups: 
lugnet.robotics
Date: 
Wed, 18 Jan 2006 15:47:33 GMT
Original-From: 
PeterBalch <PETERBALCH@COMPUSERVEihatespam.COM>
Viewed: 
1567 times
  
Message text written by steve baker
C++ programmers have to
know where to put up self-imposed walls of protection and where
to sacrifice that protection for performance.

There is no "Java is better than C++" or "C++ is better than Java".
It depends what you are doing and who is doing it.

I can't recall a single array bound
overflow problem in all that time.

Did you have array bound checking turned on? Do you know how many you've
had?

to sacrifice that protection for performance.

That's an argument that all C programmers repeat ad nauseam. And the one
about "pointer arithmetic is faster". I used to repeat them too when I was
a C programmer.

IT'S NOT TRUE !

I now write in Delphi. I have occasionally had to convert large C programs
to Delphi and every time I've done it, I've compared performance (out of
interest). Delphi is consistently as fast as C. In fact, it's usually about
10% faster but 10% is within statistical error. (These are
technical/scientific programs, not business stuff.)

Like all Delphi programmers, I always develop with "Array bound checking"
switched on. I then sometimes switch it off and re-compile to compare
speed. It's usually impossible to measure a difference. The Delphi compiler
produces extremely efficient code. (If I have to get the last ounce of
speed, I use sub-range types and the compiler does almost all bounds
checking at compile-time.)

And occasionally, I'll try replace array indexing over large arrays with
pointer-dereferencing and pointer-arithmetic. (Yes, Delphi allows it. Yuk.)
It's usually marginally slower. Not faster.

So I'll repeat, IT'S NOT TRUE ! You don't ever have to sacrifice
performance for protection.

Was it Knuth or Dijkstra who said "turning off bound checking when
development is complete is like wearing your life jacket in the harbour but
taking it off when you go out to sea".

Peter



1 Message in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR