Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> PHP is probably the best language for server side webdev today.

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.



I have and to suggest replacing php/js with haskell as the best server side tool in general is signs that someone may be living in a bubble.

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.


> I have and to suggest replacing php/js with haskell as the best server side tool in general is signs that someone may be living in a bubble.

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.


Php has been around for 20+ years which means the pool of experienced developers is much larger than other ecosystems with new languages. Greenfield php projects by experienced developers are created everyday.

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.


The idea is that there are different things that different languages offer, and you need to know "what's out there" before you can claim that one language is the best.

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.


Can you list off some successful web dev projects using Haskell right now?


Hasura, JanRain, tools made by Oblomov, Silk (discontinued), Wagon.


> When someone brings up haskell as a best choice for server side web development as a replacement for php

Who is saying that? I've read through this thread and I have not read anything to that effect.


he's strawmanning me with this... I called him out, but he still keeps going.


When discussing server side web dev, I think the most important aspect is the ecosystem and libraries/frameworks available as much as the language itself.

> 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.



In my opinion, what makes a "language" the best for webdev is not its syntax. It is the ecosystem, the libraries, the amount of people that know it, the learning curve, the editor plugins available, the frameworks, etc.

Ocaml? Elm? Clojure? Haskell?. That's fun for side projects, not for real business.


Why do you treat PHP and JS as similar languages? They're worlds apart, have different purposes and have almost nothing in common.


> Why do you treat PHP and JS as similar languages? They're worlds apart, have different purposes and have almost nothing in common.

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.


A fairly useful addendum to your list might be 4) both have grown up into completely ok languages.

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.


> 4) both have grown up into completely ok languages.

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.


Find me a language without a few of those classic 'wat' quirks. They almost all have them.

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.


> The issue was never "weirdness" but rather poor design.

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.


> To me all weirdness IS poor design.

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.


They have so much in common. They're far more similar than they are different. Both are procedural, object-oriented, loosely-typed. Their syntaxes are both loosely-derived from C. The similarities go on.


> object-oriented

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.


Your response is a perfect example of why these discussions are so difficult. What makes a language “good” depends heavily on your priorities and perspective.

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.


while there is certainly merit to choosing a language with a large talant pool. It drives me nuts how so many employers optimize for hiring juniors. Hiring a Junior is like getting a puppy and now you're picking a language that minimizes the scale of their messes.

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.


I much rather let juniors work on my Elm app than have on my JS app.

Strong typing helps me trust code is of certain quality.


I’ve personally tried projects in Ruby, Elixir, and node. PHP has been the best experience for me across both dev and production. Elixir has an excellent local environment story though!


> Have you written some Rust, Kotlin, Swift, ReasonML/ReScript/OCaml, Haskell, Elm or Clojure?

Nah, I like to get shit done and make buckets of money.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: