Earlier quoted context omitted.
> [...] its defenders should focus on actually showing what modern PHP code looks like. Laravel does this very well, not just by being a great framework but also in its ecosystem (Envoyer, Forge, Spark, Nova, Horizon, Socialite) and its documentation ( https://laravel.com/docs/master ).
Laravel has a Java-like problem of too many indirections, and has a really complex application model that breaks a lot of things. For that you gain an end of 00's quality templating system and ORM. I understand that PHP developers love it. It's orders of magnitude better than doing everything by hand. But no, thanks.
PHP in 2019
221–230 of 489 posts
Re: PHP in 2019
#222Earlier quoted context omitted.
https://crystal-lang.org
Your parent comment has a point about performance; I don't see why he is downvoted. Crystal is cool, but it is still immature in terms of ecosystem, the language could change, limited library support, and most importantly, not many great engineers . Particularly not outside of the valley. Performance is a concern for many people, and this is somewhat overlooked because of the number of people here who work for compan…
Re: PHP in 2019
#2231. people seem to hate writing (old?) PHP, and
2. there are a good dozen languages that were created solely because people hate this other language Javascript, which both compile to Javascript and have the semantics of Javascript, just not the syntax or stdlib of Javascript;
...why we didn’t end up with languages compiling to PHP, targeting the Zend VM, or whatever you’d have to do to get the PHP module in Apache to interpret non-PHP code.
Re: PHP in 2019
#224Earlier quoted context omitted.
Yep. Laravel is basically PHP on Rails. They do a great job with it too.
I dunno... Their home page looks like something out of the Panera Bread playbook looking at the homepage. 'Web artisans'? Why is it 'clean' because it has an absurd amount of whitespace and comments of platitudes for the code example?
From the home page of a few other frameworks:
Django: "The web framework for perfectionists with deadlines."
Flask: "Web development, one drop at a time"
Express: "Fast, unopinionated, minimalist web framework for Node.js"
Pyramid: "You need a Python web framework that supports your decisions, by artisans for artisans."
Why is it clean? Build an application with Laravel and you'll find out. :) The documentation and community are excellent. I've used many frameworks across many different languages, and (imo) it really is very nice to work in.
It's funny how the most negativity comes from people with very little experience, or at least recent experience, in the thing that they don't like.
Re: PHP in 2019
#225As far as I'm concerned the bridges have burned a long time ago and I definitely can't see myself giving PHP a second chance. That being said, if I'm wrong and PHP has really managed to become a decent language (or at least something that's not completely insane) its defenders should focus on actually showing what modern PHP code looks like. Is performance that much of a big deal for most people? In a world where Rub…
> ven assuming that "modern" PHP managed to come up with better ways to deal with all of this, I assume that these obsolete functions and operators still linger for backward compatibility? If so how do you avoid them? I think the "path of least resistance" is important: developers are time-constrained, understanding-constrained, lazy (if they're virtuous), etc. There's a big incentive to do whatever is easiest/quicke…
You are absolutely right that the path to this has been fixing the path of least resistance. Laravel and other frameworks have made it easy to get variables using their preferred methods (and automatically sanitizing input). Learning resources (tutorials, docs) utilize the OO functions and many of the older functions were deprecated and have been removed for years. If you look at one of the more infamous functions, mysql_real_escape_string (https://www.php.net/manual/en/function.mysql-real-escape-str...) that was removed entirely in PHP 7. If you look at the more modern mysqli, they've chosen to have both escape_string and real_escape string, but one is an alias to the other. Similarly, sane defaults have become the norm, especially since most developers are using containers or VMs/vagrant to program. The one major outstanding issue is the api naming is still inconsistent.
On a sidenote, the PHP docs are great with pages showing examples and notes talking about potential issues. When I switched to python I couldn't believe how bad the docs were in comparison.
Re: PHP in 2019
#226I’ve only seen positive changes in the time since then.
I’ve made a good living from writing code and I don’t see any reason that has to change.
Re: PHP in 2019
#227Earlier quoted context omitted.
despite it's pre 1.0 status it's arguably more production ready than php ever was/will-be etc.
I bet you rely on things written in PHP way more than you realize.
I see no reason to start any greenfield project in 2019 in PHP unless you literally only know or ever want to learn PHP. I could be wrong in terms of the entire language and it's ecosystem could have changed in the 18-20 years since I deliberated interacted with it last... We have a lot of things since mod php, so there's many other options, most of which don't involve PHP, so I suppose true fans will build their web apps in forth, I dunno...
Re: PHP in 2019
#228Earlier quoted context omitted.
Every time I try out Flask, Aiohttp or even Express.js I appreciate more the stuff Django normally does for me.
Django abstracts away a bit too much, if you ask me. For a simple REST API it's complete overkill. I prefer Flask or Falcon[0], in which you don't just get better performance[1] but also a lower level of control. [0] https://falconframework.org/ [1] https://klen.github.io/py-frameworks-bench/ or https://github.com/the-benchmarker/web-frameworks
Personally I consider Django without any additional apps less complex than Flask with apps (or "plugins" in Flask jargon) to handle basic stuff like auth.
If performance is a concern, both of them are insufficient and I would rather pick another language like Rust, Go or even Java.
Re: PHP in 2019
#229Earlier quoted context omitted.
I bet you rely on things written in PHP way more than you realize.
Exactly. See: Wikipedia, Facebook, WordPress, etc. People talk crap about PHP but it is a workhorse of the web.
Re: PHP in 2019
#230So much of the web is powered by PHP. Wikipedia (MediaWiki software) and Facebook are two of the largest footprints of usage. And of course, WordPress. PHP has a lot of firepower behind it.
Having worked with both, any one of the major additions (XHP, good type annotations, sane collection types, etc) makes my development experience 10x better; going back to vanilla PHP now just makes me sad...