DEV Community

Adam Crockett 🌀
Adam Crockett 🌀

Posted on

Should I stop doubting PHP

I am very open minded about languages apart from one, honestly I don't know why, PHP has a reputation mostly due to security and the reason for that is it was used alot! And the biggest fish are the best targets. The other thing that bugs me is that I don't see it like C or Java or Rust or what have you, it's home turf is on the server, that's not the case for more general purpose lower level languages. The other thing that bothers me is that PHP exolved from a templating language, it's like seeing pug or ejs or other becoming a fully fledged language way out of the scope of it's original purposes.

I do like the branding and Laravel thought, I must be very shallow 🤣

Top comments (5)

Collapse
 
jerry_hopper profile image
jerry hopper

yes you should stop doubting.

in 1999 i switched from ASP to PHP due to jobchange. and despite many people told me php is no good, it has always served me well.
With php 7+ both security and speed are drastically improved.
Especially composer has been a awesome addition to php. And now, with frameworks like laravel, symfony or api-platform - php is my primary choice.

Right now, i whip up a API in minutes. For frontend i use react.

So i see no reason to doubt php - or go lengths to learn something new.

Stuff you definatly need to checkout which makes php a wonderfull thing:
Composer,SlimFramework,Symfony,Laravel,Doctrine,Api-Platform and swoole.

Collapse
 
dao profile image
Dao Shen • Edited

You are not shallow. There are language design decisions (you mention one) that prevent me from using PHP for anything serious too.

As with nearly anything though, it may very well work for others. My chief concern is when i see organizations choosing to use or stay with PHP as a primary business language. If there is a long term case for doing this, i've not encountered it yet.

Every single thing that PHP does can be done in JavaScript today.

Collapse
 
franksierra profile image
Frank Sierra • Edited

Security implementation its not and should not be language's business but yours.
It depends on you, to do it right.
When you hear someone saying "PHP is insecure" they are probably talking about someone else code, not the language.
That same person could have used Python (just to name one) and make the same exact mistakes.

So, yeah. You should stop doubting PHP ASAP.

Oh and most of the current trends on web development languages started as something else not as fully fledged development languages

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

I feel that a languages design and std library absolutely could be insecure by its lack of safety. People say it's not languages but code, but languages are created by parsers designed at a lower levels, PHP itself can and has made mistakes as many other mentioned php7 plus is a lot better. So my nervousness is justified for the scale of enterprise attacks mounted against PHP in the past.

That said I'm not just going to close my mind off to the idea of using PHP that is why this post exists.

Your passion for it makes me think a little about trying a project out.

Collapse
 
andrewbrooks profile image
Andrew Brooks 👨‍💻 • Edited

Laravel fanboy here.

The Laravel core team puts a ton of effort into nailing security aspects of PHP down so you may be pleasantly surprised. Also PHP7 is a different animal than it's predecessors although like most languages it has its issues still.

A lot of the issues for security revolve around the fact that PHP makes it easy to do things many different ways with most of those ways not being a best practice, but with the low barrier to entry many beginners will write unsecure PHP code.

If you're curious I suggest checking out the Laravel from scratch series on laracasts.com to get a feel for the framework.