Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #22473

Re: Wierd use of "new function() {}"

From Joao Rodrigues <groups_jr-1@yahoo.com.br>
Newsgroups comp.lang.javascript
Subject Re: Wierd use of "new function() {}"
Date 2013-12-29 11:52 -0200
Organization Aioe.org NNTP Server
Message-ID <l9p9e3$tjo$1@speranza.aioe.org> (permalink)
References <ROqdnRynNfBWDCLPnZ2dnUVZ5u2dnZ2d@giganews.com> <l9o88p$rqd$1@speranza.aioe.org> <5j00c91lgo66p9s4qbj8f24l56suvlh9dr@4ax.com>

Show all headers | View raw


On 29/12/2013 09:07, John Harris wrote:
> On Sun, 29 Dec 2013 02:26:02 -0200, Joao Rodrigues
> wrote:
>
>
>    <snip>
>> Douglas Crockford once wrote: "It is never a good idea to put new
>> directly in front of function. For example, new function provides no
>> advantage in constructing new objects."
>    <snip>
>
> There's another dodgy author.

If you compare JavaScript books' authors, I think that Douglas Crockford 
is not so bad.

> What you've quoted may mislead people :
> "new objects" should be "new function objects". There are advantages
> when constructing other kinds of object.
>

Yes, what I've quoted may mislead people if they don't read the article 
containing Crockford's explanation:

<http://yuiblog.com/blog/2006/11/13/javascript-we-hardly-new-ya/>

But don't think that I'm one of his fanboys (if there are any). I don't 
like when Douglas rants against the equal operator (==) as if coercion 
was something to be avoided. Coercion is everywhere in JavaScript.

-- 
Joao Rodrigues

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Wierd use of "new function() {}" "Robert Crandal" <noreply2me@yahoo.com> - 2013-12-28 20:06 -0700
  Re: Wierd use of "new function() {}" "Robert Crandal" <noreply2me@yahoo.com> - 2013-12-28 20:42 -0700
    Re: Wierd use of "new function() {}" Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-12-29 17:45 +0100
  Re: Wierd use of "new function() {}" Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2013-12-29 02:26 -0200
    Re: Wierd use of "new function() {}" John Harris <niam@jghnorth.org.uk.invalid> - 2013-12-29 11:07 +0000
      Re: Wierd use of "new function() {}" Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2013-12-29 11:52 -0200
      Re: Wierd use of "new function() {}" Ben Bacarisse <ben.usenet@bsb.me.uk> - 2013-12-29 19:39 +0000
        Re: Wierd use of "new function() {}" John Harris <niam@jghnorth.org.uk.invalid> - 2013-12-30 15:27 +0000

csiph-web