DEV Community

Discussion on: Imposter Syndrome: PHP Edition

 
xicarus profile image
Sergiu-Lucian Petrica

So what are you gonna use then? Javascript?

Thread Thread
 
deceze profile image
David Zentgraf

There are so many more options out there for server-side development than PHP and Javascript. So. Many. More.

Thread Thread
 
imsop profile image
Rowan Collins

Sure, and some of them are better than PHP, some of them are worse. There's a lot of comments on this page saying "use something other than PHP", but it would be a lot more helpful if people shared their favourite alternatives, and why they think they're worth learning for someone who already knows PHP.

Thread Thread
 
xicarus profile image
Sergiu-Lucian Petrica

I know there are more options, but the fact remains that PHP works very well in its space. And that space is wide, judging by the fact that it's used for all sorts of web apps, including APIs.

Thread Thread
 
xowap profile image
Rémy 🤖

If you ask for my personal favorite, I always go with Django (so Python).

The prime reason is the ORM. It has become so powerful that I rarely need to write SQL anymore (even for very complex queries). It also provides introspection onto the data model, which allows automated forms, admin and so on. Basically any CRUD backend is done instantly. But most of all there is a migration system that gives deterministic results and works really well with versionning and branching.

Also there is the Django REST Framework which uses the introspection abilities to make REST APIs dead simple.

Then comes all the nice "batteries included" things from the templating engine (which inspired Twig) to standard RSS or sitemap apps you can just configure to go.

And finally there is a lot of apps that will help you for common tasks, like Wagtail which will provide a very flexible CMS or Oscar which does e-commerce. All those things are not in the form of WordPress/Prestashop/etc. They are developer-oriented toolkit so you can match your client's needs while leveraging pre-existing building blocks.

Basically, everything is simple and works well. That's why I like it.

Thread Thread
 
xicarus profile image
Sergiu-Lucian Petrica

Well that sounds exactly like Laravel. Perhaps you should give it a try.

Thread Thread
 
xowap profile image
Rémy 🤖

I'll admit that Laravel looks like a nice piece of framework. It has a lot of good things and certainly is not too nerve-wrecking to work with.

However, it sounds a lot like Django of 2010. Just to pin one single issue down, the migrations system doesn't play well with branching. That's a serious no-goer.

Thread Thread
 
thinsoldier profile image
thinsoldier

sandor11 - Why do people constantly compare a framework (django) to raw php and feel that is a fair comparison? I see "x-framework vs php" statements 50x more often than I see "x-framework vs php-framework" statements.

Rowan Collins asked for people to "share their favourite alternatives" to PHP. Rémy replied with a framework once again and compared features of the framework like ORM to raw PHP! WTF? There are many PHP frameworks with ORM's and also standalone ORM libraries! Guess what Rémy. I don't use php frameworks but "I rarely need to write SQL anymore" also. And then Rémy goes on to list more libraries and frameworks as reasons why python+django+lots-of-frameworks is better than raw php by itself. That makes no sense.

Specifically saying Laravel's migration features are inferior to Django's is the only fair and sensible thing Rémy has said.

 
xowap profile image
Rémy 🤖

Hello no, JS is bad enough on the front-end for me not wanting to use it on the back-end.