Hacker News new | past | comments | ask | show | jobs | submit login

Ok i will admit it, i didn't understand a thing. Would someone care to explain it to me?



I'm not really sure if this is right, but my best guess is that script parsers use a hash table to map the name of a function to a function pointer or something. Hash tables enable fast information retrieval by some key (usually a string). By just knowing the key you immediately (or after some calculations) know in which bucket to search for the element. For details see http://en.wikipedia.org/wiki/Hash_table.

For the hash table to be efficient, an algorithm that stores the elements has to evenly distribute them across the buckets. But instead of using a "proper" algorithm, a string length was used to determine in which bucket a function name belongs. To have the names evenly distributed, the names had to be of different lengths, even if that meant abandoning some naming conventions.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: