Hacker News new | past | comments | ask | show | jobs | submit login
Ruby is not giving stress to Core computer science (ruby-forum.com)
1 point by luckydev on March 6, 2011 | hide | past | favorite | 1 comment



In languages like Ruby, the benefit of having a data structure written in C often outweighs the benefit of having a more appropriate data structure in the same complexity class, when it's written in Ruby. So there's no reason to consider using a trie, or some other interesting data structure, if the default hash table is written in C. And if you really cared about performance you could write that part in C.

And if you have a specific need it's often just as good to create a side-table rather than some intricate thing built out of nodes and pointers that you would have in C.

When you need something like a sorted dictionary, the sortedness is often just a feature of the underlying database, if it's a web app. It's fairly rare that you need things like randomly accessed sorted maps for stuff that isn't already in a database.




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

Search: