Why im switching from PHP to the MEAN stack

First of all, let me say that I don't recommend using a hammer for a screw. What I mean by that is you have to use the appropriate tool for the job. For a small client project, Wordpress and PHP may be ( and often is ) the best tool for the job, for another job, Laravel may be a good fit. For me though, I will be leaning more and more twoards the MEAN stack every chance I get.

So over the last few years I have had the privilege to work with what I consider to be some of the most cutting edge technologies and frameworks on both sides of the open source spectrum. From PHP frameworks like CakePHP and Laravel to client side libraries and frameworks like Backbone and Angular and browserify.

Reason #1: I like to be on the next wave of what's coming. Not learning what has been.

Let's face it, it takes a lot of time to stay up to date. To be a great developer, not just merely get by. While Laravel takes advantage of a lot of great technolgies, there are things you simply just cant do. For example, if you want to use web sockets, you have to still use node and something like socket.io and then implemnt some sort of PHP workaround. Why go through the extra headache and add another layer of moving parts when you can just eliminate the middle man?

Secondly, with the advent of tools like npm and browserify the development process is feeling nicer and nicer for local dev. True PHP has composer, but the fact that you can run node packages in the browser using browserify is pretty cool. You cant say the same about PHP.

Reason #2: Cross Platform Development

Ionic. I don't really need to say much more after that ... but I will. Say a client needs a SPA. Why limit them to just the browser? The hybrid frameworks that exist now for mobile development are amazing. Ionic leverages angular along with a bootstrap like style guide to deliver drop dead gorgeous joys of code to work with that we call mobile apps. Look at what you can do with javascript. There are projects out there for video streaming, Netflix like things, full scale messaging apps like gitter, Native apps like adobe brackets, and much more built on top of robust JavaScript architectures. The ability to do everything from mobile apps, tv apps, and simple website's all in the same language is phenomenal.

Reason #3: Joy of development

The dev tools that are in chrome are amazing. Why cant we use those all the time? Well you can use it a lot more if you are using MEAN. The process of templating, error handling, debugging becomes a lot easier to digest if you are able to set breakpoints, easily see logs in a console, and watch requests and responses conveniently. Stepping through code is way easier for me than it is using PHP. Sure, i've tried using PHP Storm and Xdebug. Sometimes that process doesn't work for my environment, there's browser bookmarklet's to use tons of configuration settings to do, environmental changes to make ect.. Yuk. Chrome dev tools work right out of the box and a mean stack implementation comes w console.log and util.inspect. Furthermore, with gulp and browser-sync, It's dead simple to create a quick dev server, connect all my devices, and speed the dev process along super efficiently.

Also, I don't need to setup a ton of VM's to work in. Even with homestead it's still a pain having to bootup vm's. When my code starts acting weird I have to reboot the vm sometimes. Most of the node tools you use get installed locally per project, when you're done, just blow away the node_modules directory since all of it is saved in the package.json or shrinkwrapped.

Conclusion: Use what works for you.

The bottom line comes down to what do you love to work with, what do you think will work for your project. For me, it seems like jobs seem to be trending twoard node dev. Tech in general wants more flexibility, speed to launch, and better processes all the time. Mean seems to be what aligns best like that to me at this point in time. Let me know what you think.