4 ms·
PHP7 has improved life when dealing with legacy systems, but I think all in all you're better off not building new stuff in it. There are almost always better t
by jchw 9y ago
PHP7 has improved life when dealing with legacy systems, but I think all in all you're better off not building new stuff in it. There are almost always better tools for the job than PHP, like Django, Rails, Go's net/http, etc. depending on the kind of thing you're writing.
- stephenr 9y agoSo, framework-vs-language arguments without any kind of explanation why are in huh? Ok, I can dig it. Instead of wearing sneakers you should wear cloggs or flip flops.
- deleted 9y ago[deleted]
- jchw 9y agoIf you want more detail on my position, I wrote more here: https://news.ycombinator.com/item?id=14884665 https://news.ycombinator.com/item?id=14884665
- bdcravens 9y agoI haven't built anything in it (and rarely touch PHP, aside from some Wordpress ecosystem stuff), but if I were to build a web app in PHP today, I'd build it in Laravel vis-a-vis "raw" PHP.
- icelancer 9y ago>There are almost always better tools for the job than PHP, like Django, Rails, Go's net/http, etc. depending on the kind of thing you're writing. Except for the time when you are 10 times more proficient in PHP but none of those languages. Then no, none of those languages are better for the job.
- deckiedan 9y agoIt depends. I'm way more proficient in Python than anything else, but I'll still reach for PHP fur a single page template / dynamic report, or awk for some jobs, bash for others, Perl if there's exactly the right CPAN lib, ditto ruby or node, c for some jobs... Some times a different language can so utterly change/simplify your approach to a problem it's 100% worth it.
- deevus 9y agoThat sounds more like all you know how to use is a hammer, so everything is a nail.
- reefoctopus 9y agoSometimes all you need is a hammer because it's actually a nail.
- jjeaff 9y agoMore like, all you need is a Swiss army knife, and there are dozens of different Swiss army knives that can all get the job done. So use the one you are most familiar with.
- icelancer 9y agoPHP can do probably 95%+ of all functions of the languages you listed. The analogy doesn't quite hold.
- jchw 9y agoIf you don't do very much stuff, then sure. But most people end up coding long enough that learning new things is well worth the time. It's not like it takes more than a few months to learn a new framework or language, and you get benefits beyond just the new tools. Visual Basic is still a language that many people know better than other languages, but I'd not advise those people to stay on VB just because they know VB. And PHP is getting a fresh coat of paint but that doesn't mean it isn't antiquated - what other web based programming environments provide a CGI model where scripts are in the public directory? How many of them are HTML with directions for the actual programming language? If PHP is intended to stand on its own as a web development language, they've missed a few bits of low hanging fruit already. Like, take HTML out of the language. Package PHP with Composer. Allow for a new app base model where apps have their own FCGI servers and routing is done in PHP. I mean why not? These are things that modern users of PHP already try to accomplish, sometimes with [ugly hacks that are prone to security issues](https://www.acunetix.com/vulnerabilities/web/nginx-php-code-execution-via-fastcgi https://www.acunetix.com/vulnerabilities/web/nginx-php-code-...). I don't care if people think I'm just being a hater for the sake of it. I really think PHP is a dead end, and I think that because it seems the focus for PHP development has been toward making older software like MediaWiki run better rather than make PHP a better platform overall. As far as scripting languages go, it has a history of confusing, non orthogonal behaviors, legacy cruft, bad documentation, and designs that promote or directly cause security problems. And it has such a problem with memory management that the gold standard is to simply kill the PHP instance every N requests.
- greenhouse_gas 9y agoThere's one thing none of those have that PHP has: Work with off-the-shelf managed hosting.
- jjirsa 9y agoThis is something programmers will never appreciate, and every small business on earth has already encountered Go build your client's new website in go, and then spend 80 hours trying to make it work with their $5/month hosting
- jjeaff 9y agoAnd then after you move on, be cursed for all eternity when they have to find and hire someone with go experience to fix that tiny bug. Costing them 3x as much as if it was just PHP where anyone and their brother can work on it.
- greenhouse_gas 9y agoYou can get it to work with a $5 a month VPS. The issue is more that a VPS requires constant maintenance. Let's say my friend runs a store. He needs a website. I can: 1. Find a $5 a month shared hiding plan. As it's Shared, they don't let you start servers, so go (as well as python) is out of the picture (unless you run it as a CGI - yuck). You develops the site, sell it to him, and fix on contract. You never have to do another thing for him. 2. Get a $5 a month VPS, spend another $1 a month (or more) on an S3 backup. Ensure said backup works (try it out once in a while). Keep OS up to date. Which is easier? Which is more maintainable? Does anyone think that if WordPress was written in Python it would get nearly as much traction? That's why PHP won the internet (and that VPSs were extremely expensive until a about a decade ago) - servlets where around for a long time but you couldn't run it on a shared server - made it dead on arrival.
- cutler 9y agoJust switch them to a $5/mth Linodode VM and push your one-off prepared Docker image. They're now getting 1GB RAM for their money so no complaints.
- memco 9y agoIn addition to PHP itself undergoing a lot of good optimizations a lot of tooling and frameworks have come a long way as well. Composer and most modern frameworks play much nicer in the ecosystem and it is quick and easy to get something up and running which gives access to most of the things you'd need in a webapp. I'm a big fan of Laravel personally but there's plenty of other great options nowadays.
- Can_Not 9y agoWhy would you use Django, Rails, Go's net/http, etc. when there's almost always better tools for the job like laravel, symfony, silex, rust, etc?