Need to recompile a Java Applet as an Executable

K

Keith Thompson

Lew said:
Keith said:
Arne Vajhøj said:
Anyone that has read "Java for absolute beginners" know that
int's in Java are not objects and use the exact same number
of bytes as C (on platforms where C int is 4 byte).
[...]

Since this is cross-posted to comp.lang.java.programmer and
comp.lang.c, let me clarify that point.

C defines an "object" as a "region of data storage in the execution
environment, the contents of which can represent values". This has
nothing to do with object-oriented programming. Thus a declared
variable of type int certain is an "object" if you use the C
definition of the term. (Note that C++ uses a very similar
definition.)

I don't know how "Java" defines the term.

And I don't know why I put quotation marks around "Java".
That may be, but the context to which Arne replied and that you
excised claimed that Java has tons of memory overhead to represent an
'int' by virtue of being an object, which is a bloody falsehood.

And I'm sure that Arne was correct and the previous poster was wrong
on that point. That just didn't happen to be what I was commenting
on.
Clearly that poster was using "object" in the current conventional
computer-programming sense of the word, and not in your more
specialized frame.

Yes, clearly. But he did so in an article posted to comp.lang.c.
FYI, and it absolutely freaking *ASTOUNDS* me that anyone presuming to
call themselves a programmer today has not gotten familiar with
object-oriented programming at least enough to know what an object is,
I mean, come on, already! - an object in Java is exactly what it is in
any object-oriented programming environment. Roughly it's a struct
with built-in functions.

What makes you think I'm not familiar with object-oriented
programming?

I was making a relatively narrow point, that the term "object" can
have more than one meaning. Since this thread is cross-posted to
comp.lang.c (where we tend to use the C standard's definition of
"object") and comp.lang.java.programmer (where, quite reasonably,
I'm sure they use the Java definition of the term), I thought it
was a point worth making.

I just checked the Java language definition:
http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#4.3.1
An _object_ is a _class instance_ or an array.
So yes, an int variable in Java is not an "object" in the way that
Java defines the term. I'm not at all surprised to learn that,
nor did I say anything that implies otherwise.

And, as I mentioned, C++ (which is often considered to be an
object-oriented language) has a definition of "object" that's very
similar to the C definition; in C++, a variable of type int *is*
an object.
You really should expand your study. Start with the Wikipedia
definition, perhaps read Grady Booch. Being a C programmer is not a
good excuse. In fact, it's no excuse at all.

Excuse for what? (And I happen to program in C++ for a living;
I just don't discuss C++ in comp.lang.c.)
 
S

Stefan Ram

Keith Thompson said:
in C++, a variable of type int *is* an object.

No, in C++ an object is a region of storage, while a variable
is introduced by the /declaration/ of an object. You can have
undeclared objects in C++, which thus are objects, but not variables.

In Java, »variable« has yet another meaning, which corresponds
to the meaning of »object« in C and C++.
 
K

Keith Thompson

No, in C++ an object is a region of storage, while a variable
is introduced by the /declaration/ of an object. You can have
undeclared objects in C++, which thus are objects, but not variables.

Ok. I was using the term "variable" in an informal sense. The C
standard in particular doesn't define the term, and only rarely
uses it.
In Java, »variable« has yet another meaning, which corresponds
to the meaning of »object« in C and C++.

The lesson, I think, is that you have to be very careful even with
(or especially with) seemingly fundamental and obvious terms like
"object", "variable", and so forth. They can have different meanings
in different contexts. The meaning of "object" in C and C++ is
clear and unambiguous. The meaning of "object" in Java is likewise
clear and umambiguous. They're just very different meanings.
 
A

Arved Sandstrom

Keith said:
Ok. I was using the term "variable" in an informal sense. The C
standard in particular doesn't define the term, and only rarely
uses it.


The lesson, I think, is that you have to be very careful even with
(or especially with) seemingly fundamental and obvious terms like
"object", "variable", and so forth. They can have different meanings
in different contexts. The meaning of "object" in C and C++ is
clear and unambiguous. The meaning of "object" in Java is likewise
clear and umambiguous. They're just very different meanings.
Maybe I'm missing something here, but I fail to see how the meaning of
"object" is all that different between C++ and Java. In both cases it's
an instance of a class, which means they are also regions of storage.

The relevant difference as I see it is that in Java object variables are
references - declaring one does not create an object and it doesn't
even necessarily point to one. Copying a reference simply copies the
reference. Whereas in C++ an object variable actually _is_ an object -
the variable declaration calls the ctor, and copying creates a new object.

The meaning of "variable" in Java does not correspond to the meaning of
"object" in C++, not in any meaningful way. A Java object reference - a
variable - that *has been initialized* provides a way of accessing the
object storage by reference, and if anything a C++ pointer to an object
is closer to that idea, since it's not tied to any particular object.

AHS
 
K

Keith Thompson

Arved Sandstrom said:
Keith Thompson wrote: [...]
The lesson, I think, is that you have to be very careful even with
(or especially with) seemingly fundamental and obvious terms like
"object", "variable", and so forth. They can have different meanings
in different contexts. The meaning of "object" in C and C++ is
clear and unambiguous. The meaning of "object" in Java is likewise
clear and umambiguous. They're just very different meanings.
Maybe I'm missing something here, but I fail to see how the meaning of
"object" is all that different between C++ and Java. In both cases
it's an instance of a class, which means they are also regions of
storage.

No, an "object" in C++ can be of any type, not just of a class. By
definition, in C++, "An object is a region of storage" (section 1.8 of
the C++ 2003 standard).

As I said, the C++ definition is similar to the C definition: "region
of data storage in the execution environment, the contents of which
can represent values (C99 3.14).

Perhaps the meaning of "class" is different in Java? (After a *very*
a quick at the Java language specification, I don't think so; it
seems to refer only to types declared with the "class" keyword.)
In C++, "classes" are a particular subset of types. For example,
int is not a class, but instances of type int are objects. In Java,
as I understand it, an instance of type int is not an "object",
because int is not a class.

[...]

I understand that the word "object" is widely used to refer to an
instance of a "class", but that meaning is not universal.n
 
P

Phil Carmody

Lew said:
Keith Thompson wrote: ....
You really should expand your study. Start with the Wikipedia
definition, perhaps read Grady Booch. Being a C programmer is not a
good excuse. In fact, it's no excuse at all.

Keith, no! Please don't do it!

Friends don't let friends read Grady Booch.

Phil
 
A

Arved Sandstrom

Keith said:
Arved Sandstrom said:
Keith Thompson wrote: [...]
The lesson, I think, is that you have to be very careful even with
(or especially with) seemingly fundamental and obvious terms like
"object", "variable", and so forth. They can have different meanings
in different contexts. The meaning of "object" in C and C++ is
clear and unambiguous. The meaning of "object" in Java is likewise
clear and umambiguous. They're just very different meanings.
Maybe I'm missing something here, but I fail to see how the meaning of
"object" is all that different between C++ and Java. In both cases
it's an instance of a class, which means they are also regions of
storage.

No, an "object" in C++ can be of any type, not just of a class. By
definition, in C++, "An object is a region of storage" (section 1.8 of
the C++ 2003 standard).

As I said, the C++ definition is similar to the C definition: "region
of data storage in the execution environment, the contents of which
can represent values (C99 3.14).

Perhaps the meaning of "class" is different in Java? (After a *very*
a quick at the Java language specification, I don't think so; it
seems to refer only to types declared with the "class" keyword.)
In C++, "classes" are a particular subset of types. For example,
int is not a class, but instances of type int are objects. In Java,
as I understand it, an instance of type int is not an "object",
because int is not a class.

[...]

I understand that the word "object" is widely used to refer to an
instance of a "class", but that meaning is not universal.n
Education received. :) Although I stand by what I said if we restrict
ourselves to classes.

AHS
 
A

Antoninus Twink

That is not in any way typical.

It is completely off the scale for unlikelihood.

But if I remember correct from last time you gave the story, then you
can not explain exactly what the code did.

Richard Heathfield is a notorious comp.lang.c fantasist.

It is obvious that he has never done any programming work in the real
world - no shop I've ever known would tolerate his truculent attitude
and his prissy refusal to step beyond a purely academic view of language
purity and get his hands dirty with pragmatic code that might actually
work.
 
A

Arne Vajhøj

Richard Heathfield is a notorious comp.lang.c fantasist.

It is obvious that he has never done any programming work in the real
world - no shop I've ever known would tolerate his truculent attitude
and his prissy refusal to step beyond a purely academic view of language
purity and get his hands dirty with pragmatic code that might actually
work.

I don't recognize that description.

He does not seem to have much faith in VM based runtimes.

That does not exclude programming in the real world.

Arne
 
N

Nick Keighley

On 02-02-2010 15:11, Antoninus Twink wrote:
[...]
Richard Heathfield is a notorious comp.lang.c fantasist.
It is obvious that he has never done any programming work in the real
world - no shop I've ever known would tolerate his truculent attitude
and his prissy refusal to step beyond a purely academic view of language
purity and get his hands dirty with pragmatic code that might actually
work.

I don't recognize that description.

He does not seem to have much faith in VM based runtimes.

That does not exclude programming in the real world.

twink's a troll with a problem with Richard Heathfield.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top