6 ms·
> Not trying to bash on PHP or perpetuate the knee-jerk PHP hate, but should we really encourage people to learn PHP? Too late, you already did. And yes we sho
by Killswitch 13y ago
> Not trying to bash on PHP or perpetuate the knee-jerk PHP hate, but should we really encourage people to learn PHP?
Too late, you already did. And yes we should. PHP is just as good as Ruby or Python.
- Conlectus 13y agoI would say from a usability / opportunity of employment standpoint they are equal, but PHP seems when working with it far less "designed" than Python and Ruby in my opinion. Things like the inconsistency of single word / snake case / camelcase in method names etc.
- riquito 13y agoMaybe, but the standard library always makes my heart beat faster. We're talking about the language where you have pearls like strcspn, strtr, strstr, strpbrk and at least three different naming styles for the same group of functions (e.g. for strings strtr, str_replace, trim). 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...)
- astrodust 13y agoNo, it's not "just as good". It's stuck as web development language due to design constraints. Python is useful for a lot more than web scripting, and so is Ruby.
- RyanZAG 13y agoI don't use PHP much - but if you're making a website, why is being able to do things other than make websites important? I wouldn't use Ruby or Python to make desktop or mobile apps anyway.
- astrodust 13y ago"Web sites" are just the tip of the iceberg today, there's a lot more to the internet than just that. For example, if you wanted to add real-time connectivity to your app using something like Socket.IO (http://socket.io/ http://socket.io/) you're basically out of luck in the PHP world (http://stackoverflow.com/questions/6398887/using-php-with-socket-io 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.
- xd 13y agoThere is nothing to stop you writing persistent PHP socket servers and there are many examples out there. A quick and easy to digest example of an implementation of memcached in PHP: https://github.com/AndrewRose/cached.php https://github.com/AndrewRose/cached.php
- astrodust 13y agoYeah, like I'm going to use that in a production environment. 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.
- xd 13y agoIt's an example of what can be done. And yes libevent has been abandoned but has also been superseded by http://us3.php.net/event http://us3.php.net/event 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.
- Killswitch 13y agoWeird, then all these big companies who use PHP are wrong? And the fact that PHP dominates the web is wrong? Hmmm... I think you're wrong.
- astrodust 13y agoRight or wrong is highly subjective. Big companies use Java. Does that mean you're doing it wrong if you're not using Java? I think you're misunderstanding what I'm saying.
- farresito 13y agoIt's free to criticize PHP; that's why everybody does it, but at the end of the day the quality of a certain product depends on the programmer, not the language.
- xd 13y ago"It's stuck as web development language due to design constraints" 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.
- dscrd 13y ago> 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.
- Segmentation 13y ago> in very strong terms that this comment is nowhere near the truth. It was his opinion, not a fact. Just like this is your opinion and NOT fact.
- dscrd 13y ago> Just like this is your opinion and NOT fact. Well, if that is your opinion, I do apologize.