|
|
nemesis wrote:
> Darren New <dne### [at] sanrrcom> wrote:
>> You're saying "a hastable is for lookups. It doesn't have an order.
>> Therefore, Python is right to base its data structures on hash tables."
>
> It's supposed to be a hashtable.
What is "supposed" to be a hashtable? And why do you say it's "supposed" to
be a hashtable?
> If you don't want a hashtable, you shouldn't use it.
Of course not. Because it *is* a hashtable, whether that's what you want or
not.
>> Well, there ya go. So why isn't that built in, like it is in PHP, since it
>> allows both random and sequential lookups? :-)
>
> Because Python, Scheme and Haskell attempt to use the correct approaches. Form
> follows function.
And what is incorrect about PHP's approach? Why is Python more "correct"
than PHP? (Note: "because it uses hashtables" is a circular argument.)
>> So, it's OK for a mathematical set to maintain order when it's simpler,
>
> A math set has no order. I was saying the notation of functions over set
> domains employs the convention of lists of arguments because it's simpler to
> notate than named arguments out of order.
I understand that. You're missing my point. You're arguing that keyed data
structures in a programming language should not preserve insertion order.
I'm asking you why that is the case, and you're answering "Because!"
I'm just trying to figure out why you think a structure with a superset of
the functionality that a hashtable provides is a bad thing.
> and that ought to be a good thing.
Why? Do you actually *have* a reason beyond "because"? Or is this a
faith-based argument?
If you need a hashtable, PHP's arrays give that to you. If you need a list,
PHP's arrays give that to you. If you need order-preserving keyed-access
data structures, PHP's arrays gives that to you, and Python doesn't. If you
need order-preserving keyed-access data structures in Python, you have to
implement it yourself. I'd say that's a bad thing, for all the same reasons
that having non-standardized implementations of any application-independent
data structures in any language is a bad thing.
--
Darren New, San Diego CA, USA (PST)
There's no CD like OCD, there's no CD I knoooow!
Post a reply to this message
|
|