PHP has come a really long way, I really hope to see it's resurgence some day after everyone has been burned enough from running JavaScript as their server.
PHP has come a really long way, I really hope to see it's resurgence some day after everyone has been burned enough from running JavaScript as their server.
People seem to love to hate it because it's the "cool" thing to do. Yet PHP developers continue to ship things faster, while JS devs are probably still fiddling with their Node environment setup...
While I agree with this, I think the tone is slightly dismissive. From what I have seen, older people in our trade seem to recommend against PHP due to it having a terrible relationship with consistency, functionality, performance, etc. in its history. Though I have (thankfully) seen that the language and its standard library has undergone several large improvements, which is great to hear.
> Yet PHP developers continue to ship things faster, while JS devs are probably still fiddling with their Node environment setup...
On your point of JavaScript, the build environment nonsense can definitely get hairy. It's why we get things like Deno, which attempt to throw all this cruft away and start again. And sometimes that's a good idea. If you're dedicated to Node, replacing Webpack with Rollup seems to be what is generally recommended. The only obvious disadvantage there is compatibility with Webpack plugins.
It would be nice to have a type-checked JavaScript variant with a practically non-existent build environment (no Webpack, Rollup, etc.) As much as I adore TypeScript, the compiler itself is massive and takes quite a long time to even start.
As an older person in the trade, I don't agree with the other older persons. Only consistency is a problem with PHP code, and that is largely NOT caused by PHP. Inconsistency is the product of developers coding without any real thought about how to abstract things (ok, well, maybe not in the case of magic strings). You can do this with every language. Some languages do everything possible to force consistency, and developer still find a way to be delightfully inconsistent even with the syntactic equivilent of bowling gutter bumpers (see Cobol, Go, Java). Consistency is a developer problem. You can write great code in languages that are terrible.
PHP has never been slow (compared to other dynamic languages), or lacked functionality. If there is a rub on PHP it comes from no separation of code and presentation, which flew in the face of the MVC pattern which was THE WAY for a very long time. Now... well, JSX much? Anyhow, my team works with Go, JS, PHP and Python, and the code that takes the least effort to both extend and maintain is... the PHP.
It just. Doesn’t. Matter. Choose Symfony or Laravel, and you are in for a wonderful development experience, from setup to dependency management to architecture to implementation to testing to deployment – for certain kinds of projects it’s just perfect.
The truth is, those who care to use the language properly know this already. Those who wish to dismiss it always will, and this happens to be an easy angle of attack.
Doubt. Your "something@v1.2.3" in Deno is no different than "something": "^1.2.3" in npm. The problems will appear when you update stuff.
The only thing benefiting deno currently is the clean slate and the lack of hacks (for now).
However if the argument is: updating libraries break stuff, that is gonna happen every time in every language. There is no guarantee the next version will just work as the last one did
Really happy to be working with it again, even if on the side for now.
Developer speed does not get enough coverage when comparing languages.
When I work with a Node project it's such a slow dragging build process.
Using PHP is like a fun superpower that lets me turn out things on timescales that are borderline miraculous to clients and management.
I can hire a top-notch PHP engineer for half of what a mid-level JS engineer would be asking.
It's not that PHP engineers are less qualified than JS. I think bootcamps shifted the market for JS developers and now really good engineers cost an arm and a leg while good junior engineers start around the $100k mark. The whole JS salary market is insane and as a startup, I can't afford it right now.
Just pay what good engineers should be paid. If there are PHP developers out there not getting the same salary as a their peers like this post mentions, you should leave that job for a better one. Please demand better, PHP developers, for all of our sakes. Business always wants to put downward pressure on salary and we need to be united against this regardless of preferred tech stacks
I've run no numbers, I have nothing but infrences to base this on, but hiring a mature PHP engineer in Europe would 100% be cheaper in the long run than hiring a junior/mid-level JS engineer anywhere else.
It’s exactly 180 degrees for me. Node js just seems to be super fast. And with typescript its heavenly.
I don't make a website and working on node js is fun. In PHP it is like doing something esoteric. Just a simple argument parsing is so hard in php compared to node js. In nodejs I use meow and even without docs, I can parse cli easily. In fact, I think Rust can be more easier than PHP in many cases. I usually rewrite in rust for long term daemons. Also in php I need to install php I don't know why I should install php-pdo etc. I mean why not just allow composer etc to handle like just like node do? I am frustrated with php stdlib which seems to be fossil at the moment.
The thing I like about PHP is laravel framework where I can set up websites instantly. Node js is fragmented with adonis and many other micro-framework.
https://symfony.com/doc/current/console/input.html
Installing laravel for cli is like buying thread ripper to run minesweeper.
With Drupal, the code quality of the core is generally okay, however the added inertia may come from a "square peg, round hole" situation, where the CMS is being used for an obscure purpose for which it wasn't really designed. This is quite common in the wild, probably due to the low barrier to entry and the fact that people will use what they are comfortable with to solve every problem under the sun (not dissimilar to the prevalence of Excel throughout the world of finance for a variety of completely inappropriate use cases).
For example, PHP could get along without async/await and promises in a lot of situations, because threading was effectively subcontracted to the underlying web-server. You could just treat, say, a curl call as blocking-- resulting in a simpler code flow-- knowing that wouldn't lock your entire web server.
The improvements over the lifespan of PHP7, and the new things in PHP8 make PHP such a nicer language to work with.
Just needs a FastCGI wrapper.
Another "Node, but PHP like" project that compares itself to EJS and other similar things: https://github.com/Yahweasel/nodejs-server-pages#why-nodejs-...