5 ms·
I'd love to debate the use of PHP vs. Ruby and Elixir, but your arguments basically are: - The community is full of people who just care about hacking somethin
by slver 6y ago
I'd love to debate the use of PHP vs. Ruby and Elixir, but your arguments basically are:
- The community is full of people who just care about hacking something together.
- Ruby/Elixir are fantastic, developer friendly, and have solid foundations.
The first happens with every popular scripting platform. Is JS community full of PhDs?
The second is highly subjective. Ruby is problematic, because it's supported by one framework which is showing its age, and the language itself has lagged behind in performance, which matters increasingly for web workloads. Elixir is a niche dialect of a niche language (Erlang). Don't get me wrong, Erlang is amazing. But you don't need Erlang to set-up a blog.
It seems the major reason going against PHP are:
- WordPress and the entire ecosystem around it sucks. Well, sure, but PHP has more frameworks with big mindshare like Symfony. It's not a "Ruby on Rails" situation.
- The meme about hating PHP is big. Everyone loves to hate PHP and Basic. Even when Visual Basic .NET evolved to be basically no different than C#, the meme of hating it lived on. Same with PHP.
The thing with memes is they're not rational. So fighting them with rational arguments is pointless. If peer approval matters to you, then code PHP in secret or don't code in it. If shipping projects matters more, PHP is a pretty good option for most websites.
- hrktb 6y agoMoving from PHP to ruby, language speed has never happened to be a subject. During coffee time banter, sure, but in real performance related issues, what we face came down to query optimizing, cache management, algorithmic issues and data pre-processing. We didn’t even hit the “let’s write this in C” moment nor debated about moving parts of the code to faster systems/libraries. I’m not saying it will never ever happen, just that ruby’s sheer speed doesn’t seem to have a practical impact other than slightly higher hosting cost perhaps.
- slver 6y agoI'm sure that's the case. But as we break down the arguments that PHP sucks one by one, it's not performance, it's not libraries, it's not this, it's not that. How about this article "PHP a fractal of bad design", oh most of those no longer apply to PHP. What's left? The slightly unwieldy syntax (still C-like, so close enough), and the bad reputation driven by memes.
- hrktb 6y agoI didn’t touch PHP 7+ for kore than hobby projects so things might have changed, but to me PHP’s main issue (and to some extent JS) was the need for a strong defensive coding discipline. There is no specific flaw that is a roadblock, just a ton of things you know you shouldn’t do, cases you need to guard against, and base functions we effectively banned from our codebase. I still like PHP, and just moved for unrelated reasons, but I think that’s a specificity of the language (as a side effect, good PHP devs also easily become good JS devs in my experience)
- gremlinsinc 6y ago> the need for a strong defensive coding discipline. PHP 7/8 have a lot more typings, it's still optional but you can require your code to use strict typings, and you can use a static analyzer like psalm to basically recommend best practices, add a few tests and your code is pretty damn solid and passes most "smell" tests and generally won't break often or as often as something in python, ruby, go. Mix in swoole and you went from 200 reqs/sec to 6k which is about 2k more than elixir, so really just about every issue php ever had is basically replaced by just more "mature" architecture. If you know advanced php, and the new features/best practices etc and use good tooling then php is an awesome language.
- colllectorof 6y agoIt's not "language speed", it's memory consumption per request that makes the biggest difference in practice.
- zozbot234 6y agoThe two are heavily correlated, though.
- klibertp 6y ago> Elixir is a niche dialect of a niche language (Erlang). Nitpick: Elixir is not a dialect of Erlang. It doesn't even compile to Erlang, but directly to the BEAM bytecode. Erlang and Elixir are very different languages. Think of it as Java and Groovy. Erlang is old, battle-tested, explicit and verbose to a fault (which stops being a fault when you try to maintain a decade+ old code) and is used mainly for writing large systems with very specific requirements. Elixir is younger, tries to be less verbose, adds magic completely absent from Erlang, and is intended to be used more like a traditional scripting language in addition to also covering the Erlang use case.
- fomine3 6y ago> Even when Visual Basic .NET evolved to be basically no different than C#, the meme of hating it lived on VB.NET is worst language on VB family, because it's totally degraded weird version of C#. I don't say VB6/VBS/VBA is cool, but it had some advantages compared to other languages.