6 ms·
The idea of using a "framework" in a language that gets completely reloaded on every new request doesn't make sense - at least I thought a framework was somethi
by astrange 5y ago
The idea of using a "framework" in a language that gets completely reloaded on every new request doesn't make sense - at least I thought a framework was something that wrapped your own code and presented an event loop, etc. You'd want a "library" if you just wanted to improve on the original low quality PHP database connectors and such.
But PHP developers always did seem to have inappropriate jealousy over unrelated languages like Java where there is persistence over requests.
- gmfawcett 5y agoYou sound like me, but ten years ago. :) I used to have a similarly negative and narrow-minded perspective about PHP, but my colleagues and their outstanding work have enlightened me.
- mst 5y agoI am entirely unfond of PHP as a language but Laravel - and competently written apps that use it - are damn impressive nonetheless.
- mekster 5y agoIf you can't like the current PHP, there's probably no language that will make you feel too well. What exactly is so bad about it?
- mst 5y agoThe point I wanted to make was that Laravel is objectively impressive even to somebody who dislikes PHP, so going into details as to exactly why I dislike the language would distract from what I was trying to get across.
- astrange 5y agoPHP itself is perfectly designed to run CGI scripts and the correct architecture for web performance (shared-nothing). It's the third party developers that have second-system effect enterprise dreams. Though maybe some of them have found simplicity again.
- slim 5y agoyou're right. it was obvious when we started seeing templating engines for php while php is itself a templating engine
- tored 5y agoOnly thing missing from PHP now is to programmatically detect tainted strings, i.e. strings that are dangerous like user input, if we had that we could continue with the built in templating and still be sure to escape output at the correct moment. Tainted strings should be built into PHP (there was an RFC for it but it didn't pass). Another solution could be using operator overloading instead (that RFC didn't pass either).
- krapp 5y agoOr do what Hack did with XHP and make XML/HTML a part of the language, and escape everything else by default. That was the one Hack feature PHP should have taken, but didn't.
- tored 5y agoIt has somewhat become better in PHP with preloading and better caches like the inheritance cache.
- motogpjimbo 5y agoI'm not sure why you've been downvoted. Anyone who has ever seen a Laravel stack trace will surely have been appalled at the number of stack frames that sit below their own code, and all that machinery is loaded on every single request. It's truly shocking. PHP isn't Java and shouldn't be treated as such.
- gmfawcett 5y agoI know what you're saying... but using Java as the counterexample? I'm still reading the stacktrace from a Java error I raised in 2003.
- astrange 5y agoI haven't paid attention to frontend web development in like 15 years so I don't have any newer examples ;( I'd hope new stuff is also CGI-based and restart on every request, otherwise you're asking for security issues (like leaking another user's info Heartbleed-style).
- tored 5y agoThere is a very strong movement for using a large framework within the PHP community, like Laravel, upside is that is has helped PHP community to revitalize the PHP stack. The downside is that large frameworks is now considered best practice. I wonder if OOP as a technique will eventually always end up as Rube Goldberg machine.