[erlang-questions] orddict (was Re: OO programming style in Erlang?)
Ulf Wiger
ulf@REDACTED
Thu Jan 25 19:53:02 CET 2007
Den 2007-01-25 03:26:16 skrev Richard A. O'Keefe <ok@REDACTED>:
> The orddict module is extremely unusual in having the same interface
> as the dict module.
So does the ordsets module have the same interface as the sets module.
> However, it does NOT have the same PERFORMANCE
> characteristics. So once again, if you want to have any idea how well
> your code is likely to work, you had BETTER know which version you are
> using. (And wouldn't it be nice if the documentation said something
> about performance?) In fact, there really aren't that many places that
> you would want to use orddict at all.
I can think of one good reason to use ordsets/orddict: debugging.
It is decidedly more enjoyable to watch (trace/debugging)
printouts of ordsets and orddicts compared to sets/dicts.
Pretty-printing of large dicts in the shell is in fact
everything but pretty.
Personally, I use ordsets quite often. I seldomly use orddict,
however, but if I do it is exactly for the reason above, and
in cases where performance is not critical.
BR,
Ulf W
--
Ulf Wiger
More information about the erlang-questions
mailing list