- Feature Articles
- CodeSOD
- Error'd
-
Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Thank you. That's what I meant by "is equal" operator, but didn't want to get into a discussion of abstract algebra. You explained it much better than I could.
Admin
Just to be clear, Perl arrays don't allow access through non-integer indexes. Perl hashes do, though. In PHP, they noticed that arrays are special cases of hashes, and so just collapsed them into a single data structure. It has it's appeal, I suppose. I just wouldn't want to program without a distinction between a hash and an array.
Admin
Another way of thinking of this is that PHP added "array-like" capabilities to the Awk associative-array structure, as long as the data follows certain rules. Either way you look at it though, it's still broken. Table-ish things and Order-ish things really are fundamentally different.
Admin
At least the guy followed a consistent pattern.
Admin
In PHP's case, it collapses down a number of different variable types ( python's dictionaries and lists ) in to a single variable type. This works for me, as now I don't have to worry about what type of variable I should use here, or as the algorithm updates if I need to change it. That's the job of the compiler/language/computer to keep track of that data, mine is simply to implement the algorithm.
I mean really, why should I care if I am implementing a list or a dictionary? How is me worrying about that beneficial to the implementation of the algorithm?
Admin
PHP is a bad language. It is a poorly planned cobbling of various elements over a long period of time.
I work with the language every work day and there are various real-world problems with the language, just do a google search for a few examples. This is not to say that you need to write poor code because the language itself is poor, it is also not to say that PHP hasn't been getting better over time. I write very clean and readable code with the language.
But to suggest PHP itself doesn't deserve some amount of poking fun at is silly. I mean, honestly, whenever you've got something like magic quotes (or hell, any language feature that needs to be called "magic") you know you're getting into some scary territory. Yes it is depreciated, but you still have to account for it when developing applications because unfortunately older versions of PHP litter the internet primarily due to the one .ini to rule them all (per server.)
PHP is a prime example of how over-simplification can actually lead to more complication.