new self invoking function

J

John G Harris

You seem to have missed the point that it is not a matter of knowledge
but communication. The specs are written for *implementors*, not
programmers. That's why JS programmers don't refer to the language as
"ECMAScript" and rarely talk of syntax in terms of "productions". ;)

So you feel that it's wrong to say anything in this news group that
would not be understood by the people who write JQuery ?

An amazing number of programmers don't know what a statement is,
including some with PhDs. That's no reason for not using the word as
defined in the language specification.


There is no need for a term for such a general case (except perhaps
for implementors). Trying to use such a term in programming
discussions will only serve to confuse.

C++ manages to find a use for such a general case, but then it's a
language for real programmers.

Your definition can be thoroughly confusing at times :

1. Back in the days of ECMA 262 v2 you could have a program where
undefined was a variable in one browser and not a variable in another
(because it was pre-defined). This is confusing.

2. Even now in v3 you can write to undefined, so it now suddenly becomes
a variable (because it has now been implicitly declared). This is
confusing.

3. When someone uses My Library they access a thing called API. It's not
a variable according to you (because they didn't declare it). This is
also confusing.

John
 
R

Richard Cornford

On 8/9/2010 9:34 AM, Ry Nohryb wrote:
thx, yeah that makes sense. I wonder if the following code
from Mozilla Dev Center kind of illustrates the tendency
to conflate scope with the this object?

I know 'scope' in this function is only a local variable

As we a re quibbling about terminology today; in ECMA 262 terminology,
in a function definition (the code that makes up a function
declaration or a function expression) the parenthesised list of
Identifiers that precedes the function body's surrounding braces is
called a FormalParameterList, which makes 'formal parameter', or
something like 'function parameter', or just 'parameter' appropriate
labels for any single item in that list (with 'argument' being applied
to the value passed into a call to a function, and so (possibly)
eventually assigned to a property of the Variable object with a name
that corresponds with the formal parameter's name ).
*name*, but it struck me as kind of a misleading in the
'way to think about it' department...

if (!Array.prototype.forEach) {
Array.prototype.forEach = function(fn, scope) {
scope = scope || this;
for(var i = 0; i < this.length; i++) {
fn.call(scope, this, i, this);
}
};

}


Yes, in a language where the scope is (potentially) complex and should
be understood it is misleading to attach the label "scope" to
something that has noting to do with scoping. Frequently people
(particularly coming from other programming languages with
expectations about how things 'should work') find it difficult to come
to terms with the way that javascript determines the value of the -
this - keyword at runtime and in response to how a function is called.
They (often) expect the - this -value to be determined by the context
of its use in the source code, but because scope (the resolution of
Identifiers) is determined by the structure of the source code any
conflation of scope and the - this - value plays into that unfounded
expectation and promotes a misconception.

Richard.
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]
september.org>, Sun, 8 Aug 2010 22:34:36, Garrett Smith
There's a big difference between that and obnoxious noise, massive
overquoting, and lazy and sloppy formatting that makes up the majority
of your postings.


Those who write carelessly and in haste, without checking what they have
written, are unlikely to be good programmers; this newsgroup is haunted
by three prime examples. David Mark posts more articles than Thomas
Lahn and Garrett Smith put together.
 
D

David Mark

So you feel that it's wrong to say anything in this news group that
would not be understood by the people who write JQuery ?

No, as mentioned, discussions have context, so generalizations about
"anything in this news group" miss the point.
An amazing number of programmers don't know what a statement is,
including some with PhDs. That's no reason for not using the word as
defined in the language specification.

I didn't say anything about that word.
C++ manages to find a use for such a general case, but then it's a
language for real programmers.

I don't care what C++ does.
Your definition can be thoroughly confusing at times :

1. Back in the days of ECMA 262 v2 you could have a program where
undefined was a variable in one browser and not a variable in another
(because it was pre-defined). This is confusing.

And irrelevant today. Not to mention that calling every global a
"variable" does nothing to make it less confusing.
2. Even now in v3 you can write to undefined, so it now suddenly becomes
a variable (because it has now been implicitly declared). This is
confusing.

That's just a case of doing something silly.
3. When someone uses My Library they access a thing called API.

A global variable.
It's not
a variable according to you (because they didn't declare it). This is
also confusing.

You misunderstood. I didn't mean you had to be the one to type the
declaration. If it is declared anywhere in your scrips(s) then it is
a variable. As soon as you include My Library, it becomes your
library. ;)
 
D

David Mark

On Aug 8, 8:01 pm, Garrett Smith
[...]

I cite the specification when the context calls for it.  For example,
three years ago you asked me to explain to you why 0 is not less than
null (presumably to avoid RTFM yourself).

That's a good example of an on-topic post, so you're capable of posting
on-topic.

As you well know, I've been posting on-topic for years. You often
disagree with my points for months on end, only to find out that you
were wrong all along. I know that upsets you, but it is hardly my
fault.
There's a big difference between that and obnoxious noise, massive
overquoting, and lazy and sloppy formatting that makes up the majority
of your postings.

I picture this red-faced, foaming at the mouth, obsessive twit who
can't stand that they are virtually always wrong with regard to
browser scripting problems. Get some help.
 
D

David Mark

Try repeating that looking in the mirror.

LOL. Stop trying to be me. You can't carry it off.
Commenting on obvious typos is about what I'd


Is there a contradiction here?
Nope.


Either you're concerned about using correct terminology or you're not.

That's your typical generalized pigeonholing. About what I'd expect
from you.
Frankly I don't care about what you call it;

Call what?
you've shown repeated
unwillingness to hold civil technical discussion, trying to discuss
anything with you is pretty much a waste of time anyway, so call it
whatever you want and I'll happily ignore you.

You are doing a great job of ignoring me. :) If you are planning to
start this week, realize that you'll never learn anything if you don't
pay attention. For example, you'd still be using the - in - operator
on host objects and confused about re-flows if you had been previously
ignoring me.
if you tried to correct Jorge and then posted wrong information again
(that's about the fourth post in a row from you I've read today that
follows that pattern).

I did not post wrong information. As you well know, Jorge and I have
had this same discussion about fifty times. As I stressed once again,
*named* function expressions are to be avoided because of a problem in
IE. Jorge's ridiculous idea of "avoiding" IE is to be ignored.
 
D

David Mark

In comp.lang.javascript message <[email protected]
september.org>, Sun, 8 Aug 2010 22:34:36, Garrett Smith


Those who write carelessly and in haste, without checking what they have
written, are unlikely to be good programmers; this newsgroup is haunted
by three prime examples.  David Mark posts more articles than Thomas
Lahn and Garrett Smith put together.

I guess I write faster than they do. :) And please don't lump me in
any group with Garrett Smith, who can't seem to read, let alone write
coherent posts.

And is it your assertion that because I have a prolific posting
history I am a bad programmer? That doesn't follow (and is obviously
false).
 
D

David Mark

On 2010-08-08 09:30 PM, David Mark wrote:
On 2010-08-08 03:05 PM, David Mark wrote:
On 2010-08-08 12:45 PM, David Mark wrote:
      <snip>
[...]

So stop popping in to technical discussions with personal attacks (and
then whining when you get smacked on the nose).
The spam at least
appears in a separate thread, so it can be easily ignored. Your trash
appears all over the place.
I assume you've read the next post and are now crying in a corner
somewhere.  :)

It sounds like you want to get a little more personal.

No, but it was funny that your latest dubious generalization (and lame
attempt at an insult) about who does or does not RTFM was so easily
proven false.
Sissy flame wars are off-topic.

So stop with your lame-ass attempts at insults and you won't touch off
such "wars". Lately you talk about me more than you do JS. As such,
any comments about being OT are laughable.
If you wanted to meet in person -- and
that goes for anyone -- you could have just emailed me rather than post
a sissydramaqueen act with keystrokes. You have my email address.

Again, PKB. If you have a problem with me, you can send an email
(which I will duly ignore). ;)
I'm not getting hit in the nose and although your trash hurts my ideals
for this NG, I'm surely not crying.

See above. You are just asking for another whipping.
 
G

Garrett Smith

On Aug 8, 9:40 pm, David Mark<[email protected]> wrote:
On Aug 8, 10:17 am, Ry Nohryb<[email protected]> wrote:
NFEs ? Avoided ? Why ? NFEs are *not* the problem, the problem is
Microsoft.
*Named* NFE's. (...)
Yes, the truly, really wellnamedones:named-named-function-
expressions :)
[...]


if you tried to correct Jorge and then posted wrong information again
(that's about the fourth post in a row from you I've read today that
follows that pattern).

I did not post wrong information. As you well know, Jorge and I have

It's not "ATM", no! Its ATM *MACHINE!!!*
 
D

David Mark

On 2010-08-08 09:34 PM, David Mark wrote:
NFEs ? Avoided ? Why ? NFEs are *not* the problem, the problem is
Microsoft.
*Named* NFE's. (...)
Yes, the truly, really wellnamedones:named-named-function-
expressions :)
[...]
if you tried to correct Jorge and then posted wrong information again
(that's about the fourth post in a row from you I've read today that
follows that pattern).
I did not post wrong information.  As you well know, Jorge and I have

It's not "ATM", no! Its ATM *MACHINE!!!*

Is it your position then that I don't know what an NFE is? If so, you
are on very thin ice considering the amount of time I've devoted here
recently trying to teach Jorge not to use them. But you already knew
that (even if you didn't read the bit you snipped).

So the question is, what is your motivation for such a juvenile (and
sloppy) outburst? To look like an idiot? And this from the off-topic
police?

You are a blithering buffoon. Who appointed this idiot to maintain
the FAQ anyway?
 

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,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top