6 ms·
Why would you pick any other language instead of PHP for web dev?
by Darmody 5y ago
Why would you pick any other language instead of PHP for web dev?
- Kovah 5y agoBecause too many people learn only Javascript in their pRofeSSioNal WeB dEv BoOtCamPs so the only thing they know is JS. Why learn a solid backend-focused language if you can throw JS at it?
- paulintrognon 5y agoHave you heard of Nest.js? It's the laravel of JS, and I can assure you it is rock solid.
- jusssi 5y agoIs there now a reliable non-hacky way to do threads or async, to run queries to multiple dbs or backend systems simultaneously in PHP?
- pdimitar 5y agoBecause Elixir has transparent parallelism and trivially scales to 2000 reqs/second on a $5 VPS even though it's a dynamic language, oh and because it has LiveView which eliminates the need for most of the JS in a project (if latency isn't critical), so now a backender can take care of 100% of a web project. I worked with PHP 9-10 years ago. Still not impressed to this day. Why should I use it? Terrible type coercion that can and will catch you with your pants down is my chief complaint -- that alone is enough for me to never touch it again. I want predictable tools, not something I actively have to fight against so I can get my job done. How is this even considered productive? So tell me again, why should I use PHP? How will it truly help me? What does it do better than everyone else?
- heurisko 5y agoIf you're happy with Elixir, just use Elixir. But companies might want to use PHP, because it has a rich ecosystem, which handles corner cases. Chances are, if you want to send out bulk email, or connect to a payment provider, there's going to be a library in PHP that allows you to do that, often with long term support from an agency. A corner-case I recently had was needing to decode an email. There's a function for that: quoted_printable_decode. This is a common situation for PHP. If you have some sort of issue around the web, there's likely to be a PHP solution. And if you're a small business that needs a bit of bespoke software written, then you can easily hire someone, and know a decade later, you'll be able to hire someone if the requirements change. Much of this can also be said of the Java ecosystem. Just recently, I was using a small business that managed their bespoke business process built on a PHP CMS. They don't need 2000 reqs/second.
- pdimitar 5y ago> If you're happy with Elixir, just use Elixir. It's not that I never tried anything else. I got through 8 languages and made what I feel is an informed choice. > Much of this can also be said of the Java ecosystem. And yet, so many programmers and companies moved on from both Java and PHP to other tech and are managing very well. The company I work for has mere 6 backenders and we serve millions of visitors regularly without ever hitting >70% CPU on 3-4 servers. Citing the entrenched state of affairs is not an argument either. It's an appeal to statistics (a good chunk of which are flawed as well). I'm not going to try and convince anyone to stop using PHP or Java. Truth is, most programmers want stable predictable careers and there's nothing inherently wrong with that. I simply am not in that group.
- heurisko 5y agoYou asked > So tell me again, why should I use PHP? How will it truly help me? What does it do better than everyone else? I gave some reasons, citing problem domains for which there are stable, supported solutions in PHP. e.g. payment gateways, email handling, and citing the availability of programmers who can support medium bespoke or tailored systems. This isn't an "appeal to statistics" it's a strength about the ecosystem. Similar to Python having many solutions and libraries built around data science. > I'm not going to try and convince anyone to stop using PHP or Java. I thought you were asking a question.
- aeturnum 5y agoI mean, because I know them already and I would have to learn PHP? But I'll give examples of what I wanted to see for languages I've done amounts of work in: *Python* A disgusting level of flexibility (probably too much). You never really get trapped into anything, you can even (but should not) overwrite functions during runtime. You can make and break all the rules. Supports a number of modalities (often badly). Really killer console-based debugging tools (I love pudb for instance). *Elixir* Insanely durable data/process model that makes it incredibly difficult to damage a working path through a non-working one. Never have your entire web app crash again. Pattern-matching and message-passing based language makes expansion easy and low risk. Macros are best used carefully but when appropriate are a breath of fresh air. All the languages are turning complete. By definition you can solve any problem with any of them.