Good son, bad father: I'm leaving PHP but I love Laravel

Published

Estimated Reading Time: 4 minutes

PHP has a really shallow learning curve. It’s easy for a 8 year old to pick it up and start messing around with it. This is good and I love it about Python as well. However, PHP has been known to have a lot of flaws, one of the major reasons being because it was not built as a functional programming language but rather, just a Hypertext pre-processor. It was meant to just automate the behaviour of HTML. Around 2005, OOP was introduced to PHP and it made PHP developers feel among the big boys of the web.

However, there are still some things wrong about how it behaves in its OOP. For example when using namespaces, the following still seems wrong to me

<?php
namespace Joseph;

$object = new \Rex\say_hello();

?>

I needed the preceding backward slash to bring me back to the global namespace. But when using the use statement,

<?php
namespace Joseph;

use Rex\say_hello();
?>

Everything is wrong about this. I have friends that hate me for being a PHP developer but I chose to stick with it anyway.

While I was contemplating to leave PHP earlier before now, I had seen Anthony Ferrara’s blog post “PHP sucks! but I like it” which convinced me to still stick with it. It was a response to the popular post by Eevee on “PHP:A Fractal of Bad design”. Anthony said it’s easy to get help with PHP. At the time, I was gullible to go with it.

When I think of it now, It’s easy to get help on whatever you need if you have an internet connection. On the Freenode IRC, I went ahead to count the present number of users at this time 12/08/2014 which is the date of this article, and then I checked the users on the following channels:

##php  639 users (including bots),

#ruby 885 users (including bots)

#node.js 1299 users (including bots)

#python 1469 users  (including bots)

Doesn’t seem like PHP has much help anymore. The need for PHP developers by organizations has plummeted.

Although, the PHP community still have awesome frameworks like Laravel and Symfony where you can use composer and other cool stuff. But that’s for you the coder to think about. An average tech savvy looking to hire a developer for his new idea of a web app will ask other entrepreneurs about what’s best for development and they’ll mention Ruby-on-Rails, Python, Node. After which he starts searching for developers into those. It may take a while to convince them that there is actually a good part to the PHP that sounds evil (or never gets heard of).

Someone may come on the comments to rant that sites like Facebook use PHP. There are still big websites and CMS still making use of PHP but Facebook has been using its in-house developed language called Hack since February 2014. It’s commonly described as “All that PHP should have been”.

Facebook had to leave because they had their own better JIT runtime compiler HHVM which helps them a lot better and faster. Rasmos Lerdorf was faced with a question on how PHP could be sped up and his response was “Well, it can’t be”. He admitted! Now why should Facebook keep tweaking what isn’t getting better. They just had to get their own stuff.

This is not about criticizing PHP. Besides, I’m just a 21st century programmer. I don’t have a 10 years or 20 years programming experience but I like to do what I do right. I am really poor at ASM even as I’ve been reading some books on x86. If you are looking for critiques against PHP, the following sites can be of help

In my comment to this post on “why learn PHP”, I was soliciting for Laravel as a PHP framework because Laravel is the only reason why I still have some hopes in PHP.

###Conclusion

I don’t at all hate PHP as I’ve said earlier, it’s not like something you should not do. It’s just something you may not get satisfied with if you like to get the best results. Simply because I’m seeking to do more projects I’ll be happy with myself about, I’ll be dropping PHP after my current project. Well, I can’t leave it totally. I will still be contributing to the open source Laravel packages I’ve forked and I will have to touch it sporadically.

###References

show comments