Too late, you already did. And yes we should. PHP is just as good as Ruby or Python.
Too late, you already did. And yes we should. PHP is just as good as Ruby or Python.
I don't know if you're deliberately making a disgusting lie, a blatant troll or just lack knowledge. Either way, I wish to state, as someone who has several years of actual professional experience of all three, in very strong terms that this comment is nowhere near the truth.
But about the parent's question: I believe that no learning is ever wasted, so go ahead and learn PHP, but it might be a good idea to realize that it's quite unique in how badly designed it is, and that the rest of the programming world does many things differently.
It was his opinion, not a fact. Just like this is your opinion and NOT fact.
Well, if that is your opinion, I do apologize.
And good luck with handling non ascii data with the standard library.
PHP would need a highly deprecating major version to clean all the rubbish, but it will never happen (see the history of PHP 6.0)
disclaimer: I'm a PHP developer (during the day, but at night...)
Python is useful for a lot more than web scripting, and so is Ruby.
For example, if you wanted to add real-time connectivity to your app using something like Socket.IO (http://socket.io/) you're basically out of luck in the PHP world (http://stackoverflow.com/questions/6398887/using-php-with-so...), you'll have to do it in a different language.
I think people who invest a lot of time in learning PHP are getting less bang for their buck than they would learning Ruby or Python where their knowledge can be applied to broader disciplines.
Do you need to process audio files? Maybe write a quick script to scaffold some Objective-C or Java code for your mobile app? What about writing a persistent process that watches for files on your network, processes them and uploads them to Dropbox?
All these things are really easy with Ruby, Python, or even NodeJS, you just glue together a few off the shelf modules and you're basically done. PHP is way out of its element in these sorts of situations.
A quick and easy to digest example of an implementation of memcached in PHP: https://github.com/AndrewRose/cached.php
The libevent bindings are pretty wobbly in most languages other than C, with the exception of things like NodeJS. Plus, that project is pretty much abandoned.
Your attitude is very insulting, did you know that? You have an obvious lack of understanding of the PHP ecosystem yet feel you can belittle it with off the cuff comments at will. Please stop this behavior as it drags the entire developer community down.
In some areas people are very well off, they have developer tools, they have best practices, they produce useful, workable code. Yet they're the elite minority.
Most people have nothing, get by with scraps of code scavenged from message boards or obsolete technical books, and bang together applications that are the code equivalent of a barrio. The level of ignorance about even the most rudimentary things like SQL escaping or string concatenation vs. interpolation is staggering.
Let me be honest, I don't care if I'm insulting. I'm not saying these things to make friends or win karma. I'm saying them because PHP has problems and I don't see a lot of effort being made to reach out to the average developer learning PHP who's stumbling along, all wrong if only because they don't know better and nobody's telling them otherwise.
I'm not going to suggest that other communities don't have problems, Ruby has a standard library that's embarrassingly bad, Python has a version schism they're at a loss to resolve, NodeJS is being held back by the crippling limitations of the V8 engine, but PHP is all that and more.
For example, if you're working on a complicated C++ application and need a simple script to emit some templated files you could roll this in Python, Ruby or even Perl and a seasoned developer would be okay with that. If you wrote it in PHP, though, they'd have reservations. Why, of all the scripting languages out there, would you pick that one? Why is PHP such an albatross?
I spent a lot of time in the Perl community back when it was still a thing and witnessed what happened to a language when people didn't complain or, as you say, insult it enough. Unconditional love isn't a bad thing when dealing with people, I'm all for things being civilized, but it's toxic when applied to programming languages.
You love your pet language too much and you'll smother it, every time. Smalltalk suffered greatly because of this attitude, people pretty much loved it to death.
You want your favorite language to evolve? Be its worst enemy. Find things about it you hate so much you can't stand to endure them any more and fix them. Bitch about things that aren't right, take a stand, and be the squeaky wheel.
Every time I get into one of these discussions about PHP with someone who seems to be a big supporter of the language, I ask for one thing: Don't just tell me PHP is great, show me. Is there a guide to PHP better than PHP the Right Way (http://phptherightway.com/) that encourages people to do things correctly so they can have an experience like yours?
I don't know how many hours I've spent answering simple questions and promoting incrementally better practices, but it's got to be in the hundreds by now. I'm not even a PHP developer, I'm only focusing on the intersection between PHP and MySQL where a lot of deadly dangerous mistakes can be made, and there's not much in the way of push-back when you're going horribly awry.
Perhaps this gives me the perspective of someone working in the emergency room, where everyone seems to be on the brink of death, which is not at all like the real world. I can only report on what I'm experiencing.
If there were better resources I could link to as a sort of intervention, to help mitigate how bad this can be, I'd like to know. Right now it's like a never-ending stream of new coders with some serious MySQL escaping issues that they don't know about and problems related to the completely awful training material they've been exposed to.
If you think I'm exaggerating, just look at the sorts of questions that show up constantly and demonstrate how real-world PHP developers are producing code. Examples are so rife you can barely find a question without serious problems: http://stackoverflow.com/questions/20252023/how-to-create-au... is all too typical. Why are people writing code this way?
This does not happen in the Python or Ruby worlds. You'll get ambushed by people who will coach you in how to use Django or Rails.
I think you're misunderstanding what I'm saying.
PHP comes with a CLI SAPI that allows you to use it on the command line just like python, ruby etc and has done so since version 4.2.0 (released April 2002). I've written and maintained many cli tools and deamons in PHP over the last 11 years with great success so please get your facts straight before perpetuating falsehoods .. sorry, but I'm getting pretty sick of the ill-informed PHP bashing going on round these parts.