POV-Ray : Newsgroups : povray.off-topic : Innovative open source? : Re: Innovative open source? Server Time
9 Oct 2024 10:16:18 EDT (-0400)
  Re: Innovative open source?  
From: nemesis
Date: 5 Apr 2009 15:05:02
Message: <49d900de$1@news.povray.org>
Darren New wrote:
> nemesis wrote:
>> Darren New wrote:
>>> 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?
>>
>> Remember we're talking about Python's dict here? 
> 
> No. We're comparing PHP's "array" to Python's "dict" and "list."
> 
> I said "PHP arrays maintain order."

No, you said "A /dictionary/ in PHP is more like an array of key/value 
pairs." if I may nitpick.  Then I replied a dictionary is a hash table 
and order is not important in a hash table.

> You followed up with "Order 
> shouldn't matter in a dictionary." Hence the confusion, because you're 
> talking about Python, while I'm comparing Python to PHP.

I was not talking about Python when saying order shouldn't matter in a 
dictionary.  You look things up in a dictionary, individually.

>> I thought specialization was a good thing, specially performance-wise.
> 
> Not when you have the choice of implementing something in C or 
> implementing it in Python. Python will almost always lose in that case.

What is Python losing here with its specialized data structures, 
implemented in C?

>> If you want just an order-preserving list for your items, PHP most 
>> likely will still incur in a performance loss by calling a hash 
>> function over the item, a Python list won't.
> 
> Now you're talking about performance comparisons, when 3 sentences up 
> you said you're talking about Python dicts. See my confusion?

Why confusion when you understand perfectly well I'm now talking about 
performance and its relation to specialized data structures, and thus, 
dicts?

>> Well, why speculate when we have the sources available?
> 
> Why do I need the sources?

To see I'm not lying?

> I said that Python dicts 
> aren't as powerful as PHP arrays. Also, Python lists aren't as powerful 
> as PHP arrays.

But they are, for their respective jobs.

>> It's amazing you can nitpick and even pick a fight for tools you most 
>> likely don't even care, Darren...
> 
> I'm just trying to understand your point, having a conversation. If at 
> the start you'd said "A dict or a list is going to be more efficient 
> than a combination of the two", I wouldn't have argued in the least.

Oh, you would, sir.

> that isn't what you said, implying that there was something about the 
> topic you could teach me. Like there was some deeper, more subtle thing 
> wrong with combining the two than "it's less efficient if you don't use 
> all the features."

It's a question of principles:  specialization is good and a dict is a 
hash table, an unordered set.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.