A
Alan Gutierrez
David said:We were discussing instance. You argue that it is overloaded.David said:David Mark wrote:
Garrett Smith wrote:
On 2010-07-22 10:50 PM, David Mark wrote:
On 2010-07-22 09:36 PM, David Mark wrote:
On 2010-07-22 06:34 PM, David Mark wrote:
This is mainly for Dave, but anyone feel free to jump in.
[...]
Instances. Dave, you have said that calling JS variables instances
creates confusion.
I mentioned that calling constructed objects instances was likely to
be confusing
Calling a constructed object an instance is unlikely to be confusing.
The concept of instances exists in many other languages. "Instance" is
the correct term for what was described.
Not as I see it (or the confusion it creates). Did you read my post
at all?
What was written was corrected as it was misleading.
In your own fantasy world I presume. In reality, your response
demonstrated a stunning lack of comprehension.
I see you've snipped what was written and replied flippantly. It
reflects typical behavior of David Mark.
The specification is (still) correct.
The term "instance" is (still) a standard programming term can be -- and
is -- used to describe the concept as it exists ECMAScript. You may not
like those facts (and apparently that is the case) but that does not put
me "in a fantasy world" for stating them.
I believe David Mark was trying to argue that instance is a bad term to
describe an object instance because you can reassign the reference used
to reach the constructor when the object was created and the instanceof
operator will fail when the constructor is sought through that
reference.
That was but one example of the dubious nature of the instanceof
operator. The concept that it is unfortunately named and misleading
is not new (certainly not around here).
The only real point is that the term "instance" has connotations that
can easily confuse those used to classical OO. Same for "class" and
"singleton". As for the latter, why would you need to pigeonhole
objects as singles if there are no multiples? In fact, the use of
that term implies that there must be some other type of object (which
is the case in many other OO languages).
Is your argument that "instance" is confusing because it is overloaded
with meaning?
Partly that and partly due to the inherently confusing nature of the -
instanceof - operator. I think I've made my points quite clear.
That is true of so many words in computing.
We aren't discussing other words.
The concept of "class" my indeed not directly apply to JavaScript, butI'm not sure
where you're going with "class" and "singleton". I'm not arguing those
meanings, so I'll leave you to do that on your own.
I think those points were clear enough as well. If everything is
black, then there is no need to consider the concept of color is
there? In fact, referring to such things as "black" implies that
there must be other things that are "white".
the concept of a "singleton" is design pattern and is as applicable to
JavaScript as it is to any language.
No classes means that there is no need to refer to singletons. Quite
the contrary, such references can and will lead to confusion among
those indoctrinated in classical OOP.
Sure there is. A single instance of an object that encapsulates its
state and can possibly be a pluggable implementation. There's a lot of
value there still, even if you don't have a class, you still the concept
of type and a singleton is still a single instance of the type.
What you don't seem to realize is that that operator doesn't work as
"advertised". More confusion.
Where is the advertisement? I illustrated clearly my understanding of
how instanceof works. You have not questioned that. You only keep saying
that I seem confused based on words in my sentences, not on the
reasoning of my logic.
I understand now how it works and how it would be useful. It is useful
to determine if an instance of an object is an instanceof a particular
prototype. So long as you keep a reference to the the prototype around
and in the place where it is expected to be, it could be quite useful
indeed.
Is there some way in which it fails to work?
See my examples (which you recently quoted) with regard to that
operator's behavior.
To what end? I made a point here that you won't address.
JavaScript has user defined "type". I know it. You know it. We all know it.
It's of no interest at all at this point (except perhaps to those who
arrived late). And no, my "pedagogy" is not deeply flawed; you are
simply a newcomer who thinks he knows more than he does. There's a
new one every week.
I find it very interesting. I wish there was someone here who would
simply affirm what I've observed. That would help me learn.
I've given you considerable insight; but you seem not to have grasped
some (or all) of it.
Hmm... You've made some point about "instance" being a misnomer. I
disagree with you. You can't seem to accept that.
No, I'm really getting tired of your rapid-fire "sincerity" and
accompanying questions. You've either got it at this point or you
don't.
I'm be very considerate. I'm responding to you when you respond to me.
You're fortunate to have my attentions, just as I am fortunate to have
yours.
That wasn't an ad hominem either (it was an admonition). You seem to
have a problem with using terms in a slightly-off manner. *That* was
an ad hominem (though relevant to the current discussion).
It is not appropriate to admonish me. It can be taken as an attempt to
establish yourself as a superior, when there can be no such relationship
on USENET. It can be taken as an attempt to discredit my point by
discrediting me by saying I'm not experienced enough to make my point.
That would the definition of ad hominem. Arguing the man instead of
arguing the point.
The relevant dialog related to the OP's question is long over.
No its not. You've not addressed my reasoning on the applicability of
the word "instance".
I hope it doesn't surprise you that I have no interest in getting into
an "inquiry vs. argument" debate with you.
No, it doesn't. But, the key point here is that I'm making a valid
inquiry, and not directly to you. I expressed my understanding of
"instanceof" and sought validation, but have received none. I'd expect
someone in the group to address that directly.
Well, then. I am a humble man. You are not. I am not obligated to share
your with you your certainty in yourself.
No. And I can't help but ask, what communities would those be? If
you are referring to projects like jQuery and Dojo, then much to learn
you have.
Hmm... I'm not sure you understand the question. Do you feel you have
anything to learn from the software communities in which *you* participate?
Currently, I'm participating in com.lang.javascript because there is
much for me to learn from the other members, or at least there could be,
if this is a forum that is functioning as a forum of peers. If it is a
place for a pedagog to hold court, then it is of no value to me. It
might be of value to other people, but I don't learn that way.