DEV Community

Discussion on: Choosing PHP in 2018

Collapse
 
xowap profile image
Rémy 🤖

IMHO how much you care gives you an effort budget. The more hurdles you'll find on the way and the more you'll tap into that budget. So while you can accomplish anything in PHP (Wikipedia and Facebook for starters) sometimes it's just not worth spending your budget while other things are so much easier to use.

Collapse
 
thinsoldier profile image
thinsoldier

I would like to hear your Django over node.js arguments

Collapse
 
develcharlie profile image
DevelCharlie

I think that PHP is hated by technosnobs, by posers and by coders who don't know PHP. PHP is a way to develop efficients web applications in many flavors at reasonable cost. It's stupid today to speak about old register_globals=on or forgetting to use ===, because a serious coder knows the difference between == and ===, and knows too that data input have to be filtered as he knows that prepare statement is a good starting point, with filtering, to avoid SQLI.

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.