5 ms·
>Hint: PHP is not one of those. Hint, PHP is 100% one of those. The bad rap is either because of hipsterism or for issues that have been long solved. The rest
by coldtea 11y ago
>Hint: PHP is not one of those.
Hint, PHP is 100% one of those. The bad rap is either because of hipsterism or for issues that have been long solved.
The rest of its warts are no worse than the kind of BS any language has -- in fact before JS got in fashion the same things was said all the time for it too (for its bizarro coercion rules, only fp arithmetic, bs scope rules etc).
- untog 11y agoI agree, but if someone were starting a new project I'm not sure why I'd recommend PHP over any other stack.
- coldtea 11y agoWorks, gets constantly better, no JS-like fatigue, fast PHP7 engine, tons of tools, libs and support.
- untog 11y agoIsn't all of that true of, say, Ruby?
- prplhaz4 11y agoIt may be, but the above poster also left out one of PHP's strengths - availability. It's already running and ready to go on whatever cheap shared host you've been on for the last 20yrs. Ruby/Rails likely isn't.
- coldtea 11y agoThe "fast PHP7 engine" part not. Raw Ruby was slower (but comparable) to raw PHP, so with this new engine which consistently runs real life workloads 2x, PHP7 should be like twice as fast. And PHP still has more vendors, support in all kinds of hosts, even in third world facilities, and more companies offering commercial support. Plus there's stuff in PHP that don't exist with the same level of maturity/adoption/community in Ruby/Rails, e.g. Wordpress. And even a path to static typing, through Hack.
- contingencies 11y agoI am pretty fluent in ruby, which I learned after PHP specifically because I wanted to migrate, and I really enjoy using it. However, compared to PHP ruby is slow, it took ages before it had a half-decent unicode solution, and once you step out of the rails rah-rah it's a bit desolate on quality libraries... there's 10 half-built versions of everything, and no decent go-to implementation. On the plus side, ruby is nominally better for reflective metaprogramming, but that's really a rare use case.
- contingencies 11y agoThings I like about PHP: it's not perl, which it replaced for webdev. It's very optimized, and people with fat budgets pay for that (eg. Facebook). It connects to everything. Most of its (useful to webdev type situation) libraries are more mature than the equivalents in other languages, because more people have used them for longer. It had working unicode from the early days. It runs everywhere. Loads of people know enough of it to be dangerous / collaborate, and they tend to be numerous in the young/cheap hire pool. It's pretty much web-oriented, but can do scripting fine as well. It has a relatively stable configuration. Honestly, I think it's a very Unix-like solution to webdev problems, because it lets you roll your own solution, stays out of your way (unless requested), and encourages you to code in higher level languages. Yes, a lot of the code out there is horrible. Yes, most people code on frameworks which replace half the language with ugly hanging half-implemented abstractions. Yes, the function name thing is a pain. But mostly, really always almost mostly, it just works ... quite fast indeed, and everywhere. Yay PHP!
- singingfish 11y agoOoh, please don't badmouth perl. Modern perl (e.g. https://pragprog.com/book/swperl/modern-perl-fourth-edition https://pragprog.com/book/swperl/modern-perl-fourth-edition ) is a much more sanely designed environment than modern php is.
- contingencies 11y agoI originally wrote a long comment about how I've written CPAN modules and worked professionally in perl but will never do it again, explaining why technical betamax superiority was irrelevant because perl's users left before it got its act together, but I think in hindsight a simpler summary would be this: grep 'man perldsc' ~/.bash_history|wc -l
- singingfish 11y agoeach to their own. I'd like to do more stuff in other languages, but my perl skills are in too high demand, and it's fun.
- brightball 11y agoBecause it's relevant to this thread, here is a presentation that I did on Go from a PHP perspective for a local PHP group. http://www.brightball.com/golang/go-from-a-php-perspective http://www.brightball.com/golang/go-from-a-php-perspective TLDR: Go is good at the things PHP is bad at. PHP is good at the things Go is bad at. They actually compliment each other very well.
- true_religion 11y agoModern PHP really isn't all that bad, I still wouldn't recommend people go into PHP development out of fear that they might stumble into one of the pre-modern hellholes that I only barely escaped in the early days of my career. It's almost an irrational fear, but I remember working on plugins for applications where plugin hooks were non-existent, and the canonical approach was to patch code. I remember applications where there was no frontend server, but rather a sprawl of PHP files each doing one thing and hooking into the 'main' system via a 'require settings.php'. Apart from that, working within PHP still obliges you to do a lot of hairy things---like working with Drupal. Now Drupal is certainly better architected than say Mambo/Joomla ever was, but it's still a better CMS than it is a web framework and for some odd reason lots of companies insist on building things into Drupal even today. Now ... all of my recent knowledge is second hand, I've been out of PHP and into Python for at least 5 years now
- bro_rabbit 11y agoDrupal 8 is actually pretty nice. It can be a good choice for a web framework if you want a CMS.
- wpietri 11y agoHave those issues long been solved? I'm not snarking; I honestly don't know. I tried using PHP years ago, threw up my hands in horror, and have never touched it since. I felt a little bad about that, but a few years back Eevee's "PHP: A Fractal of Bad Design" [1] persuaded me I wasn't missing much, and that my "learn a new language" time was better spent on Scala and then Python. So what's changed in the last few years that makes it 100% as good as Ruby or Python for web development? [1] https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/ https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/
- coldtea 11y ago>I'm not snarking; I honestly don't know. I tried using PHP years ago, threw up my hands in horror, and have never touched it since. Without exactly knowing what exactly bothered you and what you use instead, we can't answer. As for "PHP: A Fractal of Bad Design", I find the article quite shallow. One could say the same things comparing something like Python to Smalltalk, and yet Python is fine as it is.
- wpietri 11y agoYou really can't answer this question? > So what's changed in the last few years that makes it 100% as good as Ruby or Python for web development? That seems like it should be pretty straightforward. > One could say the same things comparing something like Python to Smalltalk, and yet Python is fine as it is. If you've already dropped the standard from "100% as good as" to "fine as it is", then I think you've answered my question. Nobody's denying that PHP is a perfectly cromulent language; things get built in it. The servers hum, pages render, revenue is made. For its audience, it's fine as it is. fine But as far as language quality, developer experience, or aesthetic quality goes, I think PHP's kind of a mess. I don't mind that people don't care about the things that Eevee raises. Different strokes for different folks, after all. But I care about them. Personally, having spent the last year writing Python, I agree that it's fine, that it's adequate. But I think it's often no better than adequate. The object orientation is bolted on and a bit clumsy, there are 70-or-so global functions that mostly should go objects, the inclusion stuff is kinda broken, there's a bunch of stuff that looks like Java envy, etc. Given that's how I feel about Python, which is honestly fine, you could imagine why I think PHP looks like a novice in the 90s ate a half-dozen random O'Reily books and then threw up in a compiler. For people who do almost all their work in that language, have high detail memory, and are on the naturalist end of the naturalist/theorist spectrum, I think that's ok; they'll get by happily. I'm just none of those things.