Object model reformation?
rossberg at google.com
Thu Dec 27 04:12:48 PST 2012
On 27 December 2012 05:53, Brendan Eich <brendan at mozilla.com> wrote:
> I have a theory: hashes and lookup tables (arrays or vectors) have
> displaced most other data structures because most of the time, for most
> programs (horrible generalizations I know), you don't need ordered entries,
> or other properties that might motivate a balanced tree; or priority queue
> operations; or similar interesting data structures we all studied in school
> and used earlier in our careers.
> It's good to have these tools in the belt, and great to teach them, know
> their asymptotic complexity, etc.
> But they just are not that often needed.
Not often used =/= not often needed.
Seriously, I contest your theory. I think such observations usually suffer
from selection bias. In imperative languages, you see arrays used for
almost everything, often to horrible effect. In the functional world many
people seem to think that lists is all you need. In scripting languages
it's often hashmaps of some form. I think all are terribly wrong. Every
community seems to have its predominant collection data structure, but the
main reason it is dominant (which implies vastly overused) is not that it
is superior or more universal but that it is given an unfair advantage via
very convenient special support in the language, and programmers rather
shoe-horn something into it then losing the superficial notational
advantage. Languages should try harder to get away from that partisanship
and achieve egalite without baroque.
But yes, ES is probably not the place to start fixing this. :)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss