This is probably not a popular opinion, but I believe that PHP's associative array is one of the best-designed data structures in program...
This is probably not a popular opinion, but I believe that PHP's associative array is one of the best-designed data structures in programming languages. Its main distinguishing property, as mentioned in this article, is that values can be indexed by key, but are still iterated in the order they were set. This is "do what I want" in so many cases that it's just nuts. Sure, just as often it's just needless overhead, but as a programmer who prefers to reason about domain and not performance, I often don't care about that. I hate that many other languages, including C#, Ruby and Python, force me to choose between either an unordered map or a list of (key, value) tuples. EDIT: clearly, i'm behind the times with that remark. thanks commenters :-) I wish more languages had a native data type like this. It scares me that in practice JS objects have the same property, but officially the iteration order is not specified. (that said, PHP's choice to mix regular arrays and associative arrays into a single type strikes me as a bit odd. i've also never seen a good use case of arrays with mixed string/int keys)
Posted by skrebbel on Dec 23, 2014, 10:53 AM
Tags
Related issues
- You can take that “EU website” broad, as in: any website in the EU.
- I hate that they ask to log in with facebook/instagram account.
- Most people instinctively respond to hostility with hostility.
- Perhaps use Rust instead of Python to avoid installation issues?
- >There are times when, as a cyclist, I blow through a red light.
- "Sometimes I wish that I was like an air-cooled Porsche mechanic or something very stable and non-computer related, so I could just work ...
Raise real-world problems, find people facing the same issue, and discuss solutions.9,000 issues0 comments
complaint (E-commerce)
You can take that “EU website” broad, as in: any website in the EU.
I hate that they ask to log in with facebook/instagram account.
Most people instinctively respond to hostility with hostility.
Perhaps use Rust instead of Python to avoid installation issues?
>There are times when, as a cyclist, I blow through a red light.
"Sometimes I wish that I was like an air-cooled Porsche mechanic or something very stable and non-computer related, so I could just work ...
What's notable about two of those cases is that they're about frustrating the power of the electorate.
Sort commits topologically first instead of by author date
This is probably not a popular opinion, but I believe that PHP's associative array is one of the best-designed data structures in program...
This is probably not a popular opinion, but I believe that PHP's associative array is one of the best-designed data structures in programming languages. Its main distinguishing property, as mentioned in this article, is that values can be indexed by key, but are still iterated in the order they were set. This is "do what I want" in so many cases that it's just nuts. Sure, just as often it's just needless overhead, but as a programmer who prefers to reason about domain and not performance, I often don't care about that. I hate that many other languages, including C#, Ruby and Python, force me to choose between either an unordered map or a list of (key, value) tuples. EDIT: clearly, i'm behind the times with that remark. thanks commenters :-) I wish more languages had a native data type like this. It scares me that in practice JS objects have the same property, but officially the iteration order is not specified. (that said, PHP's choice to mix regular arrays and associative arrays into a single type strikes me as a bit odd. i've also never seen a good use case of arrays with mixed string/int keys)
Comments (0)
No comments yet. Start the discussion.