4 ms·
PHP is the duct-tape of programming languages. It might not be pretty but it gets the job done, and getting the job done is all that really matters. With the e
by ThomPete 12y ago
PHP is the duct-tape of programming languages. It might not be pretty but it gets the job done, and getting the job done is all that really matters.
With the exception of JavaScript which is also "wrong" by many puritan developers opinion, PHP is the only language that is welcome to complete novice programmers. All other languages require a lot of setting up.
Furthermore the ease at which I can combine JavaScript with CSS with HTML with PHP is one of the major reasons it ever got so popular. No other language allow me to do that.
- mercurial 12y ago> Furthermore the ease at which I can combine JavaScript with CSS with HTML with PHP is one of the major reasons it ever got so popular. No other language allow me to do that. If you mean by "the ease of combining Javascript with CSS with HTML" is that you get a mediocre, unsafe templating system out of the box, sure. All mainstream languages have various third-party templating libraries which are usually far superior to PHP. The big advantage to PHP is its omnipresence, large standard library and ease of deployment. It remains, however, an awful, warty language which makes it easier to do the wrong thing than most other languages I know.
- krapp 12y ago>All mainstream languages have various third-party templating libraries which are usually far superior to PHP. Including PHP, of course.
- mercurial 12y agoKind of defeats the out-of-the-box thing, though.
- krapp 12y agoMaybe, but the advantages provided by frameworks in other languages are also available in PHP, so comparing the relative safety of one language to the relative safety of a framework in another language seems unfair. Although PHP does offer the option of using the "PHP framework", which the other languages don't, so, yes, when used in one particularly bad way, PHP is particularly unsafe.
- mercurial 12y agoI don't think that's particularly unfair. PHP has always been marketed (and almost exclusively used for) web development. But it doesn't even manage to have sane templating. If using a third-party solution essentially becomes a choice between vendoring the solution and using package management solution, then the single advantage PHP had over other solutions is lost.
- deleted 12y ago[deleted]
- ThomPete 12y agoYeah the world is full of wrong things. That doesn't mean much when you have to choose between something that takes you a day to set-up to get going against something you can just start with. Thats the secret of PHP. The limits of the language means nothing to 95% of it's users and even when they do as in the case of facebook it's a problem of success and has been solved. Lets not make it harder than it is.
- mercurial 12y ago> Lets not make it harder than it is. Sure. Either your hosting provider supports your language of choice out of the box, or it doesn't. If it does, deployment will be simple. If it doesn't you still need to configure a web server and install whatever package you need (for comparison, here is how you configure Apache for the Flask Python framewrok [1], I don't see how that's significantly harder than configuring Apache for PHP). > The limits of the language means nothing to 95% of it's users and even when they do as in the case of facebook it's a problem of success and has been solved. Well, "Bobby tables" and XSS don't mean anything to a lot of people. It doesn't mean that PHP has acquired a sane templating system out of the box, that it's stdlib has acquired consistency or that it suddenly got hold of a type system. PHP is widely supported by hosting providers, and it does make it easy for inexperienced people to use it. That's, IMHO, its real strong point. Apart from that, it doesn't do anything better than other mainstream dynamic languages, and it does a lot of things considerably worse. 1: http://flask.pocoo.org/docs/0.10/deploying/mod_wsgi/ http://flask.pocoo.org/docs/0.10/deploying/mod_wsgi/
- philjackson 12y ago> and getting the job done is all that really matters Having fun whilst you work also matters. Duct-taping doesn't sound conducive to a good time to me. I want to build, innovate and enjoy. Secondly, by going with PHP you're exposing yourself to many built-in issues: http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/ http://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
- ThomPete 12y agoThe issues are not big enough for most people to care. So I would question how big those issues are from anything than a puritan point of view. They obviously does not hinder you from creating successful companies and that is frankly all I care about.
- philjackson 12y agoI think they're big enough for most of the developers that you might want to start hiring to care though. Finding and employing great PHP developers is really hard. Ruby, Node.js/Javascript, Python are all excellent, mature languages with huge pools of good developers (at least in London). They simply lack the ease of bootstrapping (as you pointed out).
- dasil003 12y agoThis is true, and I wouldn't turn my nose up at a job from a company I really like (eg. MailChimp) just because it was PHP. However as far as professional development concerned, I'd be very concerned about being hobbled by sticking with PHP over the long term. First, because it doesn't have any strong ideas to explore as a language, it just cobbles together ideas from other languages in a very ad-hoc and half-baked manner. If you want to learn the power of first-class functions with closures for instance, those things exist in PHP, but the syntax is so baroque that you'd be excused for thinking they're not worth the trouble. This effect is compounded by the fact that the PHP community is an archipelago of experts in a sea of beginners. If you're a newbie coming in it's relatively hard to figure out who to listen to to advance your skills. Finally, there's the external signaling aspect. Although it's unfair, the hard truth is that software developer talent is the classic market for lemons. Most people evaluating you will not have the knowledge and experience to evaluate your skills objectively (heck, I'm a hiring tech lead and even I can't really tell until I actually start working with someone). For a lot of people, the language you use is the signal they use, and in this regard PHP is at the bottom of the food chain just about HTML/CSS.
- ThomPete 12y agoSo here is a suggestions. Develop the other languages to be as easy to get started with as PHP and I will be the first to try it out. Cause for me it was the ease of use. I am nowhere near a programmer let alone good at programming but I can solve most of my problems with a combination of PHP, JS and CSS/HTML why should i develop in another language that takes me longer time to setup? Edit: Why the downvote? If you want to have people start learning "better" languages then it's up to you to find ways to get them to try it out.
- huskyr 12y ago> PHP is the only language that is welcome to complete novice > programmers. All other languages require a lot of setting up. One thing that is often overlooked with PHP is the fact that the deployment process if extremely easy, even for novice programmers. Simply use FTP/SFTP/SCP/whatever to copy over your files to a server, reload your browser, done. It's completely optimised for the scenario where you simply want to create a webpage. Compare that to something like Python, which is very 'novice-friendly' as well, but needs quite some steps before you have a working website deployed on a server.
- mercurial 12y agoReally depend on your hosting provider. I use gandi, and deployment is as hard "git push gandi master && ssh login@host 'deploy default.git master'". If you administrate the box yourself, I haven't found setting up, say, Apache with Python particularly hard, assuming you have enough sysadmin knowledge in the first place.
- dewey 12y ago> and deployment is as hard "git push gandi master && ssh login@host 'deploy default.git master'" That really isn't on the same level as "ftp index.php to shared webhosting provider" for most people and that's exactly the point the parent comment is trying to make.
- mercurial 12y agoWell, you can do that too. However, how does "ftp index.php" work once you use dependency management?
- dewey 12y ago"dependency management" doesn't really come into play with the scenario we are talking about which is: "It's completely optimised for the scenario where you simply want to create a webpage." [for a novice programmer] I recommend you read over the parent comment again: https://news.ycombinator.com/item?id=8709025 https://news.ycombinator.com/item?id=8709025
- ddebernardy 12y agoPHP is not duct tape when used properly. It enjoys a vibrant ecosystem (Packagist), sports one of the best dependency management systems around (Composer), and offers an outstandingly customizable framework (Symfony).
- alfiedotwtf 12y ago> PHP is the duct-tape of programming languages Perl would like to have a word with you :)
- bsg75 12y ago> getting the job done is all that really matters No matter what the language in question, that approach is why we read on HN about so many scaling failures, security breaches, and startups imploding upon success. Just getting something "shipped" is never the same thing as "done". The latter requires polish, which can be applied in any language, but it takes time.
- elektronjunge 12y agoPHP requires no setup is a myth. How many windows users can run php out of the box? None. You have to have a webserver + something like mod_php setup to get it running. How many novice programmers know how to configure a vhost with mod_php? It happens many hosting providers have this which is convenient but heroku and others have improved ease of deploy for other languages. But for local learning, PHP is no more convenient than any modern dynamic language (python, ruby, or even node.js).