5 ms·
Better is highly subjective, especially in this case. Also, why would you distinguish Java/Kotlin/C# as something different then PHP? Java/Kotlin/C#/PHP they a
by dncornholio 5y ago
Better is highly subjective, especially in this case.
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..
- jpgvm 5y agoStatic compilation, real type system, real runtime, static analysis, higher quality IDEs (IDEA, VS), higher quality libraries (Spring and ASP.NET). They are in a completely different class to PHP. That is like saying a Honda Civic is the same as an Ferrari F1 car.
- Zababa 5y ago> 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?
- jpgvm 5y agoI could have chose a better comparison but you really are completely misconstruing the point just to be edgy, i.e haha very funny but no. 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.
- dncornholio 5y agoNobody's saying banks should use PHP as their backend though.
- jpgvm 5y agoIf PHP was as good as Java (which you are arguing) then they could. But they don't. Why is that?
- Zababa 5y agoThere is no single dimension measure of how "good" a programming language is.
- dncornholio 5y agoAgain, good is subjective! 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.
- Zababa 5y ago> you really are completely misconstruing the point just to be edgy 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>.
- TrispusAttucks 5y agoYet people overwhelmingly choose Honda Civic over a Ferrari. 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.
- dncornholio 5y agoI'm going to ignore the Ferrari Civic.. 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
- jpgvm 5y agoIt doesn't have a real type system. It's dynamically typed under the hood, type declarations are just hints in PHP, the code will fail at runtime not compilation time. Compare this to prod languages where your build with just flat out fail, you don't even need to run the tests! It will just tell you X var is not of type Y, try again. 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.
- throwaway894345 5y agoStatic compilation is great but all of those languages require you to jump through hoops or have significant caveats to statically compile programs. Go is the gold standard for static compilation, and it’s pretty great to be able to deploy a single file!
- jpgvm 5y agoJava and C# are generally capable of this. It's a bit more native in Java than C# though. .NET has a rather awesome thing called the global assembly cache that makes static compilation somewhat of an anti-pattern. 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.
- mediascreen 5y agoI'm no Java developer, but JetBrains Java and PHP editors look very similar in functionality. And VS works fine with PHP.