Re: Is pointer programming even necessary?
On Mar 31, 10:01 am, "Alf P. Steinbach" <al...@start.no> wrote:
* Danno:
I have decided that this year, I will refresh my C++ skills
since they are old and brittle. I have moved onto other
languages over the past 10-15 years or so, and all the
languages I have taken to don't have the pointer logic
associated with it (Java, Ruby, etc).
I think you mean "pointer arithmetic", because Java certainly
have pointers. Java reference values are pointers. They're
called pointers by the Java language definition (just consider
what the heck you think a Java NullPointerException is all
about), and they act like pointers.
I can't say that I missed it.
Presumably, again, pointer arithmetic.
So my question is simple, is pointer programming
still viable or even necessary?
Presumably, again, pointer arithmetic.
Well, pointer arithmetic is necessary to build the foundations
of languages such as Java.
At a lower level. In practice, even in C++ (at least at the
application level), I tend to pretend that it doesn't exist, and
think of expressions like a[i] much as I would in Java.
Any indexing operation or object field access reduces at a
lower level to pointer arithmetic.
Yep, but that's the compiler writers problem, not mine.
Like you, I don't really understand the question, since I tend
to use pointers (and thus "pointer logic") a lot more in Java
than I do in C++. My impression is he's got it backwards, that
you have to concern yourself with "pointer logic" (e.g.
reference semantics, new, etc.) a lot more in Java, even when
logically, the problem doesn't call for it (e.g. an array of
complex).
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34