3 ms·
The PHP array is a wonderful data structure with an awesome set of properties. This blog post contains a lot of "problems" that are somewhat trivial and have b
by wvenable 15y ago
The PHP array is a wonderful data structure with an awesome set of properties. This blog post contains a lot of "problems" that are somewhat trivial and have been reasonably solved in PHP. This comment will be downvoted to oblivion without discussion.
- MostAwesomeDude 15y agoYou made my morning, good sir. I could not stop laughing. You have brought mirth and cheer to our workplace.
- pavel_lishin 15y ago> This comment will be downvoted to oblivion without discussion. If you can see the future, I recommend playing the lottery. If you're a snarky ass, I recommend not commenting. I've been working with PHP for five+ years now, and only started working with Python in the last year or so. You're right - working with PHP's arrayhash isn't too terribly complicated, but having actual arrays and hashes as different types is super convenient. At least once a day, I think fondly of Python and wish I could use it - list comprehensions and negative indices could eliminate the need for half of PHP's array functions and make for cleaner and more readable code.
- wvenable 15y ago> If you can see the future, I recommend playing the lottery. I can't see the future, but I can edit the past. It's just a little disappointing to be downvoted without anyone actually commenting on the subject. > but having actual arrays and hashes as different types is super convenient. I agree especially if, in the language, arrays and hashes are objects with methods. I didn't claim PHP's arrays were the greatest data structure on earth but ordered hashes that special-cases integer indexes is a pretty nice procedural-style data structure. PHP doesn't really have arrays; it's just the hash type is flexible enough to do double-duty. Apparently, on Hacker News, having such opinions is both downvote worthy and punch-in-the-face worthy.
- pavel_lishin 15y ago> It's just a little disappointing to be downvoted without anyone actually commenting on the subject. When I saw your comment, it didn't look downvoted to me. You clearly realize that people can vote on comments - has it occurred to you that comments can bounce back from a negative score? That is, unless you append some passive aggressive horse-shit to the end. Honestly, I don't know if we gain anything by PHP having arrays pull double duty in this way. The only advantage is, what, having one less keyword to remember?
- saucetenuto 15y agoYou said that PHP's arrays/hashes were awesome, but did not say why. In other words, you did not contribute to the discussion. This may have attracted some of your downvotes; certainly it made it your post unlikely to convince anyone of anything.
- zakovyrya 15y agoWith all due respect to you as a human being, Sir, I have sincere urge to punch you in the face. Please, tell me you're trolling.
- pavel_lishin 15y agoPlease don't feed the trolls.