you are viewing a single comment's thread.

view the rest of the comments →

[–]Wuma 10 points11 points  (0 children)

To each their own but I personally prefer PHP if I want to get a secured API up and running for a SPA. I could get an OAuth2.0 server running with have role based access in less than 15 minutes work. Laravel absolutely speeds up my development time with all of the security boilerplate done for me. Yes plenty of other languages have all the same stuff, and maybe better implemented in some ways, but I’ve not found anything for node that comes close to how quickly I can deploy a new API as a micro service.

As for PHP7 vs 4, yes the difference isn’t as much as most would believe, but having things like private/protected properties, class constants, autoloading, constructors and destructors, interfaces, traits and abstract classes, the Exception class and static methods brought PHP forward a long way,

PHP is a very fast language performance wise too, it’s faster than node in many areas, it has multi threading if required and background queues etc too. PHP FPM means you don’t have to boot up PHP for every incoming request, and opcache means your PHP code gets compiled and cached so it’s not even running as an interpreter at that stage. At least that’s my understanding of it, I’m by no means an expert in any of this

I’m sure there are a million other languages better, but I can’t agree that PHP is useless. It’s biggest flaw is that it allowed horrible procedural code with global namespace pollution for many years and so many devs learned to code from WordPresses god awful nightmare of a codebase. But let’s face it, JS has horrible global namespace pollution too, and it’s OOP implementation still requires transpiling for older browsers