Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!newsfeed.straub-nv.de!noris.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="ISO-8859-1" Message-ID: <1391239.xtCtL9uci3@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Wed, 10 Oct 2012 00:32:31 +0200 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 7Bit X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. Followup-To: comp.lang.javascript MIME-Version: 1.0 Lines: 29 NNTP-Posting-Date: 10 Oct 2012 00:32:32 CEST NNTP-Posting-Host: 22666bbf.newsspool4.arcor-online.net X-Trace: DXC=I^[M=keSX48RadXUBHgFh34IUKK0d@Z]ZC][K65G]Wj6?RSQa0 X-Complaints-To: usenet-abuse@arcor.de Xref: csiph.com comp.lang.javascript:16521 Patricia Shanahan wrote: > [An object] could be implemented using a combined doubly linked list and > hash table, similar to Java's LinkedHashMap. Append each new entry to the > linked list, use the hash map to find entries, and update the linked > list when an item is removed. The linked list is used to iterate in > order of appearance. > > However, JavaScript has a fairly complicated scope structure. First of all, JavaScript is an implementation of ECMAScript. One of many. And ECMAScript gives its conforming implementations a wide latitude. Ascribing features of the standard to the implementation of the standard and vice-versa is the first capital beginner's mistake in this field: The second one is ascribing features (and failings) of the host environment API to the implementation or the standard. You will find both often in books and on Web sites actually not worth reading. > Hash maps for identifier lookup make most sense if there are a lot of > identifiers in one undifferentiated scope. Linked lists are faster and > more compact than hash maps for small numbers of entries. Second, what has scope to do with the way objects are implemented? -- When all you know is jQuery, every problem looks $(olvable).