3 ms·
Language affects matters here, I think. I haven't met a Python programmer who doesn't love dictionaries, but I've seen C programmers (and to an extent, C++ prog
by Jach 14y ago
Language affects matters here, I think. I haven't met a Python programmer who doesn't love dictionaries, but I've seen C programmers (and to an extent, C++ programmers where 'std::map' is a red black tree) that avoid them because they have to roll their own or find and trust (and learn how to use) someone else's. Java programmers are more mixed. When the language forces you if you want to have nested hash tables to write "Map<String, Map<String, Map<String, Map<String, String>>> > meta_data = new HashMap<String, Map<String, Map<String, Map<String, String>>> >();" instead of "meta_data = {}", it's a pretty strong incentive to not use these things.
- mappu 14y agoTo be fair to the C++ programmers, there are several legitimate reasons to avoid std::map<> - for instance, if your project doesn't use exceptions.
- marshray 14y agoSo you don't use std::string or dynamic_cast<>() either?
- Ogre 14y agoIt's typical in game development to disable both exceptions and RTTI entirely. dynamic_cast is out on either of those counts. std::almost_everything is out due to exceptions. EA released a GPL'd "EASTL" library a few years ago for those and other reasons, you can read all about it here: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2271.html http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n227...
- marshray 14y agoI think we've had this conversation before :-)
- Ogre 14y agoI've posted that link once or twice before (once or twice literally, not sarcastically), it wouldn't surprise me if I was replying to you in one of those instances :) Here, I found it, we both posted in this thread, but not to each other: http://news.ycombinator.com/item?id=3560158 http://news.ycombinator.com/item?id=3560158
- marshray 14y agoPerhaps I saw that link on Reddit?