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

Kind of strange they don't just have a type for that. In Java we have unsorted ones (hashmap), linked ones that retain the sort order (linkedhashmap), and even automatically sorting trees (treemap / sortedmap). Honestly, considering users were relying on the key order being different from the hash order, the default type should have just been made the sorted or linked one and the type added just made unsortedmap or something. Seems like a failing of the language libraries that you have to code your own of something so basic


Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: