3 ms·
"JavaScript borrowed the new and delete keywords from its less-dynamic predecessor languages. They feel a bit out of place in a garbage collected language and a
by 1day1day 12y ago
"JavaScript borrowed the new and delete keywords from its less-dynamic predecessor languages. They feel a bit out of place in a garbage collected language and are a source of confusion for newbies "
They are? Delete maybe, due to language symantics - but not new. I think it's unfair to bundle them together in terms of newbie confusion.
Also every time I see one of these type of blog post, discussions in a book the work arounds are even worse.
JS is easy to understand, by the time you need 'new' it is not that difficult an extension of your current knowledge. As far as 'delete' even an advanced JS developer could go a year without calling it
- pjmlp 12y agoFully agree. The author probably never used Smalltalk, just to cite one of the oldest dynamic languages. btn := Button new.
- shangxiao 12y ago'new' is a source of confusion for newbies and experienced devs alike, sufficiently enough for them to ask questions on SO: http://stackoverflow.com/questions/9468055/what-does-new-in-javascript-do-anyway http://stackoverflow.com/questions/9468055/what-does-new-in-... Even I have to refresh my memory on these ambiguous parts of the language from time to time.