Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Ordered dictionaries are not conveniently supported in all languages I tend to use.

Ordered dictionaries are a fundamental, extremely basic data type present in every language I've used in three decades.

a) What modern, widely used language doesn't have them?

b) Why?

c) Okay, so you've picked a bad language that has only hashtables. You can still implement ordered keys using an array of the keys & values in sorted order, and a hashtable of keys to the array indices.



In the C++ and Rust standard libraries you have a choice between unordered maps and maps sorted by key, but not maps ordered by insertion.


The value of these representations and libraries is that they work in many places, not "It works for me."




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

Search: