Also, why would you distinguish Java/Kotlin/C# as something different then PHP? Java/Kotlin/C#/PHP they all mean the same to me. They're programming languages..
Also, why would you distinguish Java/Kotlin/C# as something different then PHP? Java/Kotlin/C#/PHP they all mean the same to me. They're programming languages..
They are in a completely different class to PHP.
That is like saying a Honda Civic is the same as an Ferrari F1 car.
In that nobody uses a Ferrari F1 car to do anything practical?
Your bank is probably running 90% Java. Every large website you use may not be written in Java but relies on mission critical systems that are etc. It's an insanely practical language, in fact probably -the- most practical language and that is why it's chosen overwhelmingly for important systems that need a large number of developers.
I'm misconstruing the point because I don't like analogies, especially when they only bring confusion. There's no need to bring cars into a discussion about Java and PHP. Programming languages are programming languages, cars are cars.
> It's an insanely practical language, in fact probably -the- most practical language and that is why it's chosen overwhelmingly for important systems that need a large number of developers.
Java being practical is part of it, its marketing to managers is also part of it. But being the most practical language for "important systems that need a large number of developers" doesn't mean that it's the most practical language for everything. To answer your first question:
> So while PHP is ok, why choose PHP when you can choose Java/Kotlin?
When you're a single developer that does lots of small projects, PHP works really well. In a way, it allows you to go faster at first. Depending on your business, that may be the most important thing, or not important at all.
While my bank is surely running 90% Java, I would bet that there are many internal applications that saves people a ton of time that are written in PHP. That's how it was at my last job at <BIG COMPANY>.
Most programming languages are 'good'. Some are just better in doing certain stuff than others. Doesn't mean the other languages are bad.
Different doesn't mean worse, or better, without context.
For Java you can easily create a "fat jar" by dropping a plugin into your build system, usually with zero or minimal configuration. (shadow is the popular one for Gradle).
I am generally not a fan of Go (for a long list of reasons) but it's compilation speed and static by default (if you disable CGO, which you should) is definitely one of it's strong points.
Real type system -> PHP has one. Static analysis is possible in PHP. Sublime, PHPStorm and VS Code are not high quality? Zend Framework, Symfony, Laravel are pretty high quality frameworks IMHO
There is some minimal static analysis. Nothing in the realm of what is available for production languages.
PHPStorm/Webstorm are decent yes, IDEA platform is pretty awesome in general but if you think those are good wait until you try IntelliJ or Rider w/Java or C# respectively. There is good reason why it's those 2 editors that made Jetbrains into the company they are today. (Note that these too are written in Java and Kotlin... which should also tell you something)
Zend/Symphony/Laravel are great for PHP, orders of magnitude better than what came before them, however they just don't measure up to Spring and ASP.NET in performance, correctness and tooling. This shouldn't be a surprise either, Spring has a long history of massive production users, everything that can be done has been done and the best patterns and libraries have been battle tested in the harshest of environments. ASP.NET has insanely large userbase because it's the only blessed framework on the Windows platform, which is way larger than the HN community gives it credit. It has insanely high level of consistency because of the massive scope of both the C#.NET standard library and the bundled functionality in ASP.NET and blessed libraries like SignalR.
That is to say, can you use PHP for web? Sure you can, you can even build some great stuff. But unless you are invested in it already these other tools -are- better, objectively better, not subjectively.
You can argue subjectively for Python, Ruby or Node.js - to me these are all in the same class as PHP and have similar quality frameworks (Django, Rails, Nest.js) but are all objectively inferior to the production languages.
I don't even get why this is controversial tbh.
I have used all of these, in fact I still choose to use some of them. I build things in Ruby occasionally, Python for some things and I started off doing web stuff in Perl and PHP.
As someone with a background in all of these scripting languages I don't think it's possible without some crazy mental gymnastics to not see how the production languages are clearly superior for almost all professional use cases.
I think the most likely case is people that think otherwise just have never tried them, at least not seriously enough to really grasp them.
Just like Java then? Your average Java code will be more solid than your average PHP code of course, but Java is far from free from runtime errors due to a not good enough type system.
> You can argue subjectively for Python, Ruby or Node.js - to me these are all in the same class as PHP and have similar quality frameworks (Django, Rails, Nest.js) but are all objectively inferior to the production languages
> As someone with a background in all of these scripting languages I don't think it's possible without some crazy mental gymnastics to not see how the production languages are clearly superior for almost all professional use cases.
What is even a "production language"? Lots of people are using Ruby, Python and Node in production, and it's working very well for them.
> I think the most likely case is people that think otherwise just have never tried them, at least not seriously enough to really grasp them.
That's a strawman.
You seem to have a very black/white view about production vs non production languages, that mostly maps to "used by classical big companies", and that doesn't seem to reflect reality very well.
If Ferrari is so superior, why is that the case?
Hell why not buy a rocket ship. Its the most superior!
Oh yeah, not practical for most use cases.