>PHP still beats the pants out of just about any other language out there in the ease of use department..
This is not true. Why is it easier than, say, Ruby
>Once people pick up PHP, then they usually start exploring other languages..
But since they are already brainwashed from PHP use, it prevents them from seeing the value of doing thing the proper way, and might see the process as contrived. This is the most dangerous aspect of using PHP. It blocks your learning and understanding. It pulls you down and keep it there.
A good example is the use of PHP arrays. It is a combination of different data structures like list, dictionaries, sets etc. But because it is a combination, you wont be able to use it as a list, or a dictionary or as a set to the fullest extent. And you will be so used to using this for every situation that you might be put off by lack of similar data structures in other languages, and blocks you from seeing the value of using the right one for a particular situation.
So I request every one who is passionate about programming and wants a career in programming to keep away from the php language and community as much as possible.
> But since they are already brainwashed from PHP use, it prevents them from seeing the value of doing thing the proper way, and might see the process as contrived. This is the most dangerous aspect of using PHP. It blocks your learning and understanding. It pulls you down and keep it there.
After 10 years of writing PHP I took a look at Python. I was confused for about 10 minutes, until I read about lists and dictionaries and saw they were different things.
Who are these people who are just trying to write other languages without looking at the "getting started with data structures" page in the guide, or reading a single book?
And why is learning something flexible and easy before learning something more advanced a problem?
> So I request every one who is passionate about programming and wants a career in programming to keep away from the php language and community as much as possible.
I was writing PHP for a living for a decade. I did a bit of Ruby along the way because it's all the same and who cares. I was then invited to CTO at a tech startup in NY, giving me a visa and moving me from the UK.
I replaced their shittily built Rails API with a PHP one which was 3x faster, did 10x more and was actually tested properly. Very handy.
Now I work for another company, Ride.com. We're building an API in Rails and it feels just like the one I built in PHP using Laravel. Almost identical.
This comapny got me a visa known as "The Alien of Extraordinary Ability" in which my PHP code was used as the basis of my skills.
All of this leads me to think: What the fuck are you talking about.
1. Languages rarely matter.
2. PHP is just fine.
3. PHP will not fuck up your career.
4. PHP will not ruin your ability to learn new languages.
5. You are an actual idiot.
Stop preaching ignorance and get on with writing software.
"So I request every one who is passionate about programming and wants a career in programming to keep away from the php language and community as much as possible." <-- keep away from php and focus on (which language)??
"And you will be so used to using this for every situation that you might be put off by lack of similar data structures in other languages" <-- http://php.net/manual/en/spl.datastructures.php
"and blocks you from seeing the value of using the right one for a particular situation." <-- technically, i do think that the average coder who works in javascript/php/ruby/php/(insert other script languages here) fails in using the proper datastructure for the problem
The above code shows php silently converting numeric string keys into integer keys. This ends up breaking the concept of a dictionary and prevents it to be used as a proper dictionary.
Also, These are the following are the functions that are supposed to be used when you want to use an array as a set.
array_diff_assoc
array_diff_key
array_diff_uassoc
array_diff_ukey
array_diff
array_intersect_assoc
array_intersect_key
array_intersect_uassoc
array_intersect_ukey
array_intersect
Consider the fact that arrays can have mixed numeric and string keys, and consider the fact that php converts numeric string keys into integer keys, and consider php weak comparison rules (2=='2'), and how do you feel about using the above functions for set operations?
You see, the php philosophy is to compensate a lack of depth with a whole lot of breadth. Instead of demanding the user to understand different data structures in depth, it provides one data structure that requires very little understanding to get started, and cover the drawbacks of with a number of functions, edge case rules, and undocumented weird behaviors (resulting from different combinations of documented, but unintuitive behaviors).
So the end result is you got away with only having to learn one simple data structure. But if you want to use it reliably, with the provided library functions, you need to keep an encyclopedic knowledge of the aforementioned edge cases gotchas. This is true with a lot of aspects of PHP. PHP is like a cheap-shitty-dangerous car that you can acquire with very little down payment on a loan with a huge interest.
>Javascript work similarly with one combined array/dict type.
Javascript have combined array/dict? How come?
>Also the PHP SPL exists..
It does not matter, People starting with php won't be aware of these pitfalls to go looking into SPL objects.
Ha! Arrays in JS are just objects disguised as arrays, with a fancy prototype and some syntax sugar: no more, no less. There are no _real_ arrays in JS (in the traditional sense).
Keys in JS arrays are _strings_, weird as it is, because arrays are just objects, and objects use strings as keys. Try this yourself:
Numbers are coerced into strings, and not the other way around! (Note that I said 'number' on purpose, since integers are available but rarely used on the web, for BC. So it's usually floats coerced into strings every time you do ['a'][0]).
This weird coertions are not much unlike PHP's, which turns anything you give it as a key into a hash, internally. Though PHP arrays are far more complex, and even weirder (like how are they're not passed as a reference or as copy, but kinda both).
On the face of it you're technically correct, and i've been bitten by numeric string key coercion in the past. But another way of thinking about it is that PHP's combined array/dict implementation is a perfectly valid set/dict, just over a subset of values where 2 and "2" are not really distinct. And clearly this was intentional given all the other parts of the language that treat types weakly.
> This is not true. Why is it easier than, say, Ruby
I can set up hosting for a PHP website without thinking. With Ruby, unless something has changed in the last 6 months (I sure hope it has) it takes me a lot more effort.
Ease of use is the entire ecosystem, not just writing programs in it.
Ruby is just "gem install rails", but IMO this discussion is misguided: initial setup time doesn't make much difference in the long run. If we're talking "how easy can a user get started", JavaScript wins by far. But that doesn't mean I'd recommend people using it.
I disagree with you - "gem install rails" is setting up Rails, but not what I was talking about: hosting the result.
I wonder if PaaS providers like Heroku would have taken off so quickly if Rails apps had been easy to set up the hosting for? It would explain their popularity outside the PHP community.
This is not true. Why is it easier than, say, Ruby
>Once people pick up PHP, then they usually start exploring other languages..
But since they are already brainwashed from PHP use, it prevents them from seeing the value of doing thing the proper way, and might see the process as contrived. This is the most dangerous aspect of using PHP. It blocks your learning and understanding. It pulls you down and keep it there.
A good example is the use of PHP arrays. It is a combination of different data structures like list, dictionaries, sets etc. But because it is a combination, you wont be able to use it as a list, or a dictionary or as a set to the fullest extent. And you will be so used to using this for every situation that you might be put off by lack of similar data structures in other languages, and blocks you from seeing the value of using the right one for a particular situation.
So I request every one who is passionate about programming and wants a career in programming to keep away from the php language and community as much as possible.