3 ms·
PHP/Laravel is a higher level of abstraction. With Laravel specifically, it's the closest thing I've seen to writing web-app business logic directly in English.
by igammarays 5y ago
PHP/Laravel is a higher level of abstraction. With Laravel specifically, it's the closest thing I've seen to writing web-app business logic directly in English. Sure, like any abstraction, it comes at a cost. Your applications would be more performant and CS-theoretically-elegant if written in C++ or Elixir/Phoenix. But you would spend a lot more time digging into segfaults, manipulating databases, and writing CRUD form boilerplate, which is far removed from your business logic.
I chose PHP for my recent startup -- despite being less experienced with PHP. The speed of development in Laravel is insane, because most of the framework is focused on making the common features of web apps more convenient. Coupled with static analysis tools and IDE helpers, all of the Laravel magic is actually understood by your IDE (PHPStorm). I've worked with Python and NodeJS for most of my career, and I've never seen this level of dev tooling. My newest project was in Laravel. I was able to ship the whole thing in half of the time it would've taken me in Django or some NodeJS framework, simply because the Laravel "magic" around databases, forms, CRUD, IDE helpers, ORM and scheduling and task queues is so fantastic.
- ashton314 5y ago> Your applications would be more performant and CS-theoretically-elegant if written in C++ or Elixir/Phoenix. But you would spend a lot more time digging into segfaults, manipulating databases, and writing CRUD form boilerplate, which is far removed from your business logic. With C++, absolutely. With Elixir/Phoenix? I never have to debug low-level issues. I also don’t have to waste time debugging stupid scope stuff and dumb data structure inconsistencies that PHP is full of. > “magic” around databases, forms, CRUD, … scheduling and task queues… “The bill comes due…” As long as you’ve got a small scope, sure, that might work. Maintenance on magic gets harder though. If the magic is what you need, you might want to take a closer look at the Phoenix system. Ecto’s DSL is just as easy as an ORM in the simple case, but is far more composable and robust in the complex cases. For simple jobs, you can just leverage the BEAM for task scheduling—I needed a little task run every 5 minutes; all it took was a dozen lines of simple code—no Redis needed! Just as “magic” feeling, but better architected and maintainable in the long-run.