Live data from Hacker News

Treating JavaScript like a 30 year old language

jeremyckahn.github.com

1–10 of 99 posts

Re: Treating JavaScript like a 30 year old language

#6

Doesn't even mention coffescript

I am debating starting up a bot which just scans for stuff like this and auto-posts a reply of "Yes, this article didn't mention your favorite buzzword, and you must be incredibly perceptive and intelligent to have noticed this and pointed it out."

Re: Treating JavaScript like a 30 year old language

#9
post #8

AFAIK, using 'new' is not a matter of preference. Omitting the keyword leads to different results. Am I missing something?

Some people think that library consumers shouldn't have to use new. Instead they should call a factory function (which itself calls new).

Re: Treating JavaScript like a 30 year old language

#10
post #4

I liked the bit about using new. As he says, some people go with capitalizing their constructors, but capitalization is not enforced by the compiler. 'new' is explicit, it can't be anything but a new object.

Well.. that's mostly true. You can get some pretty interesting results if you return something in a function invoked using new: http://wtfjs.com/2010/11/10/false-advertising
Post reply on HN