I understand you have invested time in other languages, we all have but lets focus on facts not fears of your choice of language seeming less popular.
Please read my comment again. I'm not saying Haskell is the best lang for webdev. I'm just saying that claiming "PHP is probably the best language for server side webdev today" is missing a lot of innovation that is very usable for webdev, and hint at bubble think.
The "best language for server side webdev today" is going to be a matter of taste either way. But when one's saying it is PHP, I immediately wonder what other languages the person has done webdev in: since PHP is not a very nice language IMHO.
> I understand you have invested time in other languages, we all have but lets focus on facts not fears of your choice of language seeming less popular.
So what are the facts that make PHP the best for webdev? I dont think it is often picked for greenfield project by highly skilled teams, when given the choice to pick any language they like. And that would be a fact I'd respect in this context.
When someone brings up haskell as a best choice for server side web development as a replacement for php it makes me think this person is either very new or trying virtual signal that they are smarter and more skilled because they use a more difficult powerful language. That's like saying building a laser from a kit to cut your bread is better than using a knife. Nevermind the cost, time, safety, availability of parts and employee market for each skill would clearly point to a knife as the best tool. Very few companies still in business build a laser when they need a knife.
For example, if you never programmed in any of statically-typed languages, you cannot say if they are better or worse. Similar things go for OOP-oriented stuff, or immutable-by-default languages or languages with well-designed stdlib, etc...
You may still think that PHP is the best language after trying a few other, wildly different ones, and that's fine. But unfortunately, in my experience, a lot of people who really advertise PHP (and some other languages like Pascal), haven't really tried the alternatives.
Who is saying that? I've read through this thread and I have not read anything to that effect.
> Rust, Kotlin, Swift, ReasonML/ReScript/OCaml, Haskell, Elm or Clojure?
OCaml is an excellent language depending on what you are intending to do. I can't imagine though that it would be a pleasant generic server side.
From a very quick search, it looks like to even connect to Postgres you'd have to manage yourself the connection pools ? https://medium.com/@bobbypriambodo/interfacing-ocaml-and-pos...
The same would apply to most languages on your list, except perhaps Clojure who has an excellent ecosystem thanks to the JVM. But then, is Clojure a good webdev language ? maybe ? I only toyed with it for a very short time, but I don't see it on par with PHP or ruby for instance.
comes to mind for OCaml.
https://github.com/paurkedal/ocaml-caqti
for db code.
Ocaml? Elm? Clojure? Haskell?. That's fun for side projects, not for real business.
Because (1) both very often used in webdev, (2) both have many "adherents" that totally love the language yet have little exposure to languages of different paradigms, (3) are (opinion alert) not very well designed.
I'm aware of the differences between JS and PHP.
If you, like me and many others, shrugged them both of for years and came back to them pleasantly surprised, it might change the timbre when reading that.
I'm not sure I agree that it's the best but it's got some things going for it:
- incredibly fast to deploy and iterate
- supported in some fashion on more hosting solutions than other languages or compiled binaries
- one of the best performing interpreted languages
Not all of these benefits apply to me so I don't use PHP but under the right circumstances I'd look at it again.
Counter examples:
https://www.reddit.com/r/lolphp/ (this language is soooo weird there is a community documenting its weirdness)
https://www.destroyallsoftware.com/talks/wat (lovely talk about JS's weirdness)
I dont like the fundamental weirdness of these langs. I like predicatble langs. Unpredictable langs will never be "completely ok languages" to me.
PHP was quite fairly maligned for a long time. The issue was never "weirdness" but rather poor design. Starting with final 5.x they started turning it around and deprecating or fixing a lot of the worst bits.
JavaScript was a joke but modern js is tight, clean and generally very fast.
To me all weirdness IS poor design.
> JavaScript was a joke but modern js is tight, clean and generally very fast.
Fast it sure is, for an interpreted language.
On "clean and tight" I beg to differ. I find it an unholy mess: the language, the stdlib and the ecosystem.
Weirdness is subjective. If you look at lisp for the first time coming from other languages it will be weird.
PHP had glaring issues for years, but they started to clean up the language around 7.x.
JavaScript was effectively a toy but grew up in a hurry when Node pushed ecmascript forward and into a well paced release pattern.
JS isn't per se. You can use it for OOP, but it's only a subset of what you can do with it (I'd argue there is enough traps that it's better used with other paradigms than OOP). I also don't see ES6 as very related to C syntax anymore.
To your point, PHP and JS could be close in spirit, pushing forward the good parts while letting the bad parts rot on the side, and heavily relying on programmers' discipline to build clean code. Good PHP devs tend to be good JS devs as well.
I love Clojure, it’s so well designed. Haskell is hard to beat in terms of academic type correctness. But what if I’m trying to build a web app and my priorities were, ease of hiring and productivity, especially for junior devs, and a big ecosystem. Does Clojure win here against PHP? That’s a much harder argument to make. Would anyone say Rust is a better web development language than PHP?
All these tools have trade-offs. PHP is a fantastic choice for web development, the rough edges are becoming increasingly minimal with each successive version.
I'd rather hire someone that knows what they are doing and give them tools to maximize the scale of their strengths.
2 good devs working in elixir, rails or clojure will accomplish far more than 10 juniors working in javascript or go.
Strong typing helps me trust code is of certain quality.
Nah, I like to get shit done and make buckets of money.
What are your credentials with non-PHP, non-JS/TS languages? Have you written some Rust, Kotlin, Swift, ReasonML/ReScript/OCaml, Haskell, Elm or Clojure? Those languages are different to some extend, they take fresh approaches, they contain new ideas and are scrape throat well designed.
I find most cheering for PHP and JS have very little exposure to other camps of software development.
> PHP is probably the best language for server side webdev today.
I'm telling you (opinion ahead), it most likely is not. And most likely will never be. It simply has too many fundamental design errors that have long known solutions, are near impossible to fix in PHP/JS and are fixed-by-design in other languages that also have good tooling for web-dev.
This is not just PHP/JS. But since we are looking at "the best lang for webdev" I limit myself the these and this use case.