Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #27971
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail |
|---|---|
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
| Newsgroups | comp.lang.javascript |
| Subject | Re: Style: new String( "abc" ) |
| Date | Wed, 03 Jun 2015 01:17:04 +0200 |
| Organization | PointedEars Software (PES) |
| Lines | 49 |
| Message-ID | <6829198.rnUjZSozy1@PointedEars.de> (permalink) |
| References | <new-style-20150602185946@ram.dialup.fu-berlin.de> <mkl000$bif$1@news.albasani.net> <2130550.8QLrkFYiEJ@PointedEars.de> <mkl8h8$17b$1@news.albasani.net> |
| Reply-To | Thomas 'PointedEars' Lahn <cljs@PointedEars.de> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset="UTF-8" |
| Content-Transfer-Encoding | 8Bit |
| X-Trace | solani.org 1433287188 27393 eJwFwQcBwDAMAzBKzbM7ODkNfwiTwiBoOgIeG7szx5j7uu1qQzU79bFI/46g7qqQlMVoVv4wFBGJ (2 Jun 2015 23:19:48 GMT) |
| X-Complaints-To | abuse@news.solani.org |
| NNTP-Posting-Date | Tue, 2 Jun 2015 23:19:48 +0000 (UTC) |
| User-Agent | KNode/4.14.2 |
| X-User-ID | eJwNzMERACEIBLCWWGFByuFE+i/h/GdCdfgJc7pxOCBXrK9LZsvJ7IbaVZ+lk9e8vtITRIUK8knURprJ3fmW/gFBcBSk |
| Cancel-Lock | sha1:/riaoJuxYUjPndrUdqHhth58CKc= |
| X-NNTP-Posting-Host | eJwNwoERwCAIA8CVEgOxHUcp7j+Cvf+U6ZrhdOT5Kaw10npANElBGQPfHNRuKWqfWugsuN8L6a4P6Q== |
| Xref | csiph.com comp.lang.javascript:27971 |
Show key headers only | View raw
Andreas Bergmaier wrote:
> Thomas 'PointedEars' Lahn schrieb:
>> Andreas Bergmaier wrote:
>>> Current compilers don't convert anything to an
>>> object any more here, they just call the native
>>> `String.prototype.charAt` method directly on the primitive value.
>> Cite evidence.
>
> This should get you started:
> http://stackoverflow.com/questions/17256182/what-is-the-difference-between-string-literals-and-string-objects-in-javascript
I do not see anything there that substantiates your claim. Instead, I see
an answer, <http://stackoverflow.com/a/17256419/855543>, that clearly
contradicts your claim when it says:
| I'll exemplify with V8 but I assume other engines use similar approaches.
|
| A string primitive is parsed to a v8::String object. Hence, methods can be
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^
| invoked directly on it as mentioned by jfriend00.
> The speed tests (http://jsperf.com/heera-string-literal-vs-object)
> linked from there speak for themselves.
To quote from one of my favorite books [1]:
| “/No/ data speaks for itself,” McCoy said, forceful. “Data just lies
| there. /People/ speak. The idiom ‘speaks for itself’ almost /always/
| translates as ‘If I don’t say something about this, no one will notice
| it.’ Sloppy thinking, Selv! You are dealing with second- and third-hand
| data. […]
I asked you to cite *evidence*, not inference and supposition. Sloppy
thinking, Andreas!
> You can read yourself through the V8 code, […]
That would be *one* "compiler", and what you cited already indicates that
your claim does not apply to it in particular.
_________
[1] Diane DUANE. Spock’s World. Pocket Books, 1986. ISBN 9780671041137.
p. 296
--
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not cc me. / Bitte keine Kopien per E-Mail.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: Style: new String( "abc" ) Andreas Bergmaier <andber93@web.de> - 2015-06-02 21:25 +0200
Re: Style: new String( "abc" ) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-06-02 22:27 +0200
Re: Style: new String( "abc" ) Andreas Bergmaier <andber93@web.de> - 2015-06-02 23:51 +0200
Re: Style: new String( "abc" ) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-06-03 01:17 +0200
Re: Style: new String( "abc" ) Andreas Bergmaier <andber93@web.de> - 2015-06-03 06:22 +0200
Re: Style: new String( "abc" ) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-06-03 07:57 +0200
Re: Style: new String( "abc" ) Andreas Bergmaier <andber93@web.de> - 2015-06-03 18:36 +0200
Re: Style: new String( "abc" ) John Harris <niam@jghnorth.org.uk.invalid> - 2015-06-03 15:38 +0100
csiph-web