VK said:
And where *that* gets you
(see a bit further)
I am quite happy with the position I am in now.
I had a stupid (from my side) attempt to write something
using your regular ECMAScript lingo
You man the technical terminology from the language specification? That
is the terminology which is sufficiently well defined that anyone can
read the specification and know with absolute certainly what is meant,
and so understand anyone else using that terminology (correctly) to talk
about the language.
(scope chain, Activation etc.) and I did a
mistake.
Of course you did. To use technical terminology in a technical newsgroup
you have to understand what it means (or at least be interested in
learning what it means). Without understanding it using the terminology
just degrades it into nonsense jargon used as a smokescreen to disguise
ignorance and misconceptions. And that smokescreen is not going to be
very effective if attempted in a context where others actually do
understand the terminology. That is, you can impress people who don't
know any better but the people with the technical understanding can see
right through you.
However, your previous habit of making up your own 'technical' jargon is
really worse as it turns what you say into a sort of nonsense that cannot
even be corrected, as it has no real meaning for anyone else.
Unfortunately for the newcomers and novices who read this group 'nonsense
jargon' pretty much characterises your posts. Making it more difficult
for them to properly comprehend the concepts and terminology that really
does apply to javascript.
There are *current object* (pointed by [this]) and
*default object* (used say within with(){} construct).
Nonsense.
(If anyone doesn't like these terms then she can go to
hell -
That is a poor attitude, as anyone taking these terms seriously will
understand javascript worse than in they had heard them at all. You may
not be able to perceive it but you are doing harm when you talk this
nonsense on this newsgroup.
or to any descent JavaScript/JScript reference).
So now I will not mix these terms and I know to
avoid speaking Ecmaspeak anymore. A valuable lesson.
So you will only be using your made up (or inappropriately borrowed)
jargon form now on?
There is no such thing as an "empty instance of MyObject",
beyond there being a native ECMAScritp obejct with its
internal [[Prototype]] property referring to the value of -
myOjbect.prototype - at the time.
Again: what language are you talking about?
Javascript. How many other languages would have instances of the native
ECMAScript object?
JavaScript? Java? C++? C#? VB? They all have "only one
object type" in your terms.
Strongly type languages have a very definite notion of objects being of
different types. And the compiled languages almost certainly carry those
distinctions into creating distinct structures in memory to represent
those objects.
An Object instance and say Applet instance in JVM are not
marker by different colors they are not "one is squared
and other is rounded". They are not,
You point is?
I trust you not to know what you are talking about here either.
The same structure with different set of properties and
references to other objects.
import java.applet.*;
import java.awt.*;
public class test extends Applet {
String demo;
public void init() {
demo = (this instanceof Object) ? "true" : "false";
}
public void paint(Graphics g) {
g.drawString(demo, 20, 20);
// will be "true" of course, I did not test it,
// but feel free to make an applet to see it
}
}
So Java is a single object type language? Just fine...
All Java objects are subclasses of the Java Object class (and as you
mentioned C++, that is not true in C++ ). The point of a subclass is that
it is a different type than its super-class. And the relationship is very
certain; you can cast a sub-class into its superclasses, but you cannot
cast a superclass instance into one of its subclasses.
In javascript, where there are no classes, and there is only one object
type no such restriction exists. What you call an "instance of MyObject"
is sufficiently flexible to be transferred into an instance of what is
conceptually a superclass of MyObject, and you can do that in javascript
precisely because all the objects are just instances of the native
ECMAScript object and so all of preciously the same type.
The Object object is contained in all other objects;
all of its methods and properties are available in
all other objects.
That is not true in javascript. Because the inheritance if through the
prototype chain it is entirely possible for a instance of the native
ECMAScript object to, for example, mask a method of the -
Object.prototype - object with a non-callable value. Effectively
rendering the method unavailable and unusable. You just cannot do that in
Java; Java objects can only overload the methods they inherit from the
Object base class with methods with the same signature.
Every object "first born" as a naked empty generic Object
instance and it becomes something different during the
instantiation process.
Where, and based upon what? C++ has no Object base class. Java objects
almost certainly come into existence as specific memory structures that
do no more, and no less, than accommodate objects of that one type
(because their type cannot be modified post instantiation and anything
else would waste resources).
Yet every object remembers its "babyhood": so besides of
being an instanceof its class it also an instanceof Object.
You do realise that the - instanceof - operator has very different
behaviour between Java and javascript? Attempting to draw comparisons
between the two languages based upon the results of uses of -
instanceof - is more likely to be misleading than anything else.
That's alright, the contempt I feel for you would negate the attempt if
made.
(or pretending of trying not to
- it seems
to me that javascript is the only language you know
Your perceptions are rarely accurate.
- but you know it very well.
If you really think I know javascript very well why do you argue when I
tell you that you are wrong, and if you are going to argue why don't you
test your case so you don't find yourself trying to defend an untenable
position?
I noticed it before that you have a tendency to declare
some generic OOP things as javascript-specific.
I have noticed in the past that what you say in connection with OOP
contains as many misconceptions as what you say when talking about
javascript.
I have another problem though: I know
Or, you think you 'know'. You behave as if you know something about
javascript, yet the evidence is that you know less than nothing about it.
and I have to use too many programming languages,
"Use" may be overstating what you do.
so sometimes they clinch in my head.
The contents of your head do seem very mixed-up.
Silly me.
I was wrong with this one.
So you were wrong about the constructed object being added to the scope
chain, wrong about the constructed object being an "instance of MyObject"
and wrong about the behaviour of return statements in constructors. So
what exactly were you right about.
Look at how much time you have wasted by making the mistake of thinking
that you know what you are talking about when you have repeatedly been
told hat you do not.
That's a drawback of my knowledge I guess:
Mistaking what you have for "knowledge" is your main mistake.
I don't give a damn of how something is called or ticking
until I need to know this to get my money.
Yet you re willing to tell other people what is happening, and then
object to being corrected on the rare occasions when what you write is
sufficiently coherent to be corrected.
As I never had to make a "constructor" constructing nothing,
I did not look that does return null do in the constructor
call context.
Yet you frequently use - return null; - statements in functions that are
clearly intended to be used as constructors (and that error has been
pointed out to you in the past), and post examples of such code to this
group.
Think about that for a moment. You are writing code that you freely admit
you did not understand. You were putting such stamens into code
(presumably including code that you have been paid for) without knowing
what that code would actually do. That is not competent programming, it
is programming by coincidence and by mystical incantation.
The singleton I posted was used for years w/o any problems
because you can return other object reference instead of
the newly created instance reference: but return
[some primitive] is silently ignored.
Using 'it has worked for me for years' as your only justification for
writing particular lines of code is pretty much the definition of
"programming by coincidence".
You would not last five minutes in any of the software houses that I have
worked for (indeed you would not get through their doors in most cases).
It is amazing that you have got away with your incompetence for as long
as you claim you have (but then if you are as insane as you come across
you employment record may just be another of your fictions). I can
certainly understand your desire to remain anonymous. I would be deeply
ashamed of taking money of people for the code you write.
Richard.