DEV Community

loading...

Discussion on: Choosing PHP in 2018

Collapse
perttisoomann profile image
Pert Soomann


... things are so much easier to use

Can you give a bit more detailed example? You see, 99% of posts/articles say "it's just simpler", but hardly ever give examples of what these "things" are that make other languages better.

Just trying to understand what other peoples concerns are, and then figure out how would I overcome same issues with my choice of language.

I can see from your other post that ORM is something you consider important. There are independent libraries that offer ORM capabilities, and there's one packaged in with most, if not all, PHP frameworks like Laravel or CodeIgniter.

Did you highlighted it because "it's not built in as part of language"?

Completely agree with "effort" budget - if you have to do same things over and over and over again, it'll get boring and as a dev, you loose interest.

Thread Thread
xowap profile image
Rémy 🤖

PHP has a lot of pain points. Printed errors vs exceptions. Someone forgets to use === and creates a security issue. The empty and inconsistent standard library. The lack of primitive types like sets. The fact that you have to implement modules loading yourself. I can still go on for a while...

Indeed, Laravel fights this and has gone a very long way. But why spend hours trying to figure which of your 200 files prints that space at the end of the JSON (that you didn't notice for the first hour) while you could just use a framework that is able to write your REST API at run-time using simply your data model and a tiny bit of configuration?

Thread Thread
jmolivas profile image
Jesus Manuel Olivas

Talking about building a REST-API and GraphQL application using PHP you can use the API Platform project api-platform.com/ (based on Symfony components). You can enable any model as REST/GraphQL endopint by simply adding an annotation to your model class.

This project includes 4 components:

  • API Component
    Build a fully-featured hypermedia or GraphQL API in minutes. Leverage its awesome features to develop complex and high performance API-first projects. Extend or override everything you want.

  • Schema Gen Component
    Instantly generates a PHP data model from the Schema.org vocabulary. Let the ORM create the related tables.

  • Admin Component
    Adds a convenient Material Design administration interface built with React without writing a line of code. It's a Progressive Web App!

  • Client Gen Component
    Scaffolds a Progressive Web App (React or Vue.js) or a native mobile app (React Native), and edit it to fit your needs.