4 ms·
> 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
by 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/