3 ms·
> - but I'm only half-joking when I quip that PHP has evolved from its roots as a cargo cult version of Perl into a cargo cult version of Java. It's a joke in
by adimitrov 6y ago
> - but I'm only half-joking when I quip that PHP has evolved from its roots as a cargo cult version of Perl into a cargo cult version of Java.
It's a joke in so far as it is funny - but it's absolutely correct. When you only look at the language... When looking at the VM, Java has an absolutely world class VM, with great engineering and decades worth of research poured into it.
PHP has... no such thing.
- cutler 6y agoA world class VM tied to a dinosaur language in which you still have to escape regex metacharacters.
- The_rationalist 6y agoWhat are you talking about? Java has raw strings (autoescaping) https://openjdk.java.net/jeps/378 https://openjdk.java.net/jeps/378 Moreover Kotlin allows to have a state of the art language in a state of the art vm
- chipotle_coyote 6y agoThe JVM is not tied to Java, which I think was a large part of adimitrov's observation. Kotlin, Scala and Clojure immediately come to mind. JRuby is also a fairly popular platform for Ruby. There's actually a huge list of other languages that run on the JVM, though.
- slifin 6y agoPHP has an initial implementation on GraalVM That is completely ignored by the community
- chipotle_coyote 6y agoI was definitely talking about the syntax. I'm not a huge fan of Java (as I suppose the joke already demonstrated), but I also notice how many places start out with PHP or Ruby or Python and end up moving to, if not Java, a language running on the JVM. So I still appreciate it. :) To give PHP its due, it can be very fast -- although the more you use it "the modern, right way," the slower it seems to get. I can't help but wonder how much of that is an impedance mismatch between "your program starts over from scratch with every HTTP request" and "structure your program so that by the time every class is instantiated and interface is implemented, ten thousand lines of code have been processed with each request." No matter how great its optimization and caching may be, a Laravel or Symfony app just has a whole lot of overhead relative to any framework in another language that doesn't have PHP's zero-state approach.
- mmerlin 6y ago"by the time every class is instantiated and interface is implemented, ten thousand lines of code have been processed with each request." Haha so true... the first time I stepped through a running Laravel app line-by-line in debug mode in order to understand it better, I was worried my F11 key was going to wear out ;)