News for hackers. Stuff that matters.
Re:My Experience as a Female CS Major by JonnieCache on Monday May 02, 2011 @09:40AM (#2506205)
Sorry to go down that road, but the reason people rag on PHP's associative arrays, is that its the only array that PHP has.

A hashmap with mixed keys is hardly the most practical choice for an all purpose primitive data structure.

Python already has proper arrays where you might have some chance of fast sequential access. The ordered dict or whatever is just another tool in the box.

Basically, PHP makes you do shit like this: http://www.php.net/manual/en/function.is-array.php#102652

Re:My Experience as a Female CS Major by JonnieCache on Monday May 02, 2011 @01:35PM (#2507082)
Hmmmm. I feel I may be proving the OPs entire point rather too well with this line of enquiry. I don't think I've ever trolled myself before. How embarrassing.

This kind of thing is trickier in places like HN though, because a statement is only showing off to people who already have the knowledge. There are millions(?) of people reading here, so statistically most of them probably wont know some obscure piece of knowledge about the problems of the key hashing function under random access in numerical PHP arrays. It may be showing off to the couple of people actively engaged in the debate, but to everyone else its educational.

That's most of the reason I come here, to be honest. Crumbs of insight casually discarded during the debates of much cleverer people.

Re:My Experience as a Female CS Major by sjs on Monday May 02, 2011 @07:23PM (#2508333)
Fine, s/Python/JavaScript/ then. Nobody applauds JS for it but neither is it derided as PHP is for this reason.
Re:My Experience as a Female CS Major by chalst on Monday May 02, 2011 @12:05PM (#2506707)
The same people don't seem to bash Lua's tables.
Re:My Experience as a Female CS Major by bxr on Monday May 02, 2011 @12:25PM (#2506786)
They've probably never _used_ Lua's tables.