DEV Community

Discussion on: Node vs PHP

Collapse
 
nerdlyist profile image
Coury Ryan Richards

Composer works great and you can 100% specify versions. Also, composer is the only one which do you prefer npm, bower, yarn... whatever comes next.

Syntax is an opinion. I mean don't get me wrong php could have helped itself with naming and parameter ordering consistency. Some people like ruby and I know cold fusion evangelist.

PHP has type hinting or you could move to Java or .net if you wany types and "actual oop/d".

Json is pretty straightforward with json_encode/json_decode. Where a lot of other languages you need an entire library to make that work on complex objects (no not js).

As for the question. I would say js/node are hot to trot right now. There are a lot of companies willing to pay top dollar for that skill set.

If you are starting a company though php can get all the work done for a fraction of the cost. Php developer (who creat the same systems) are very underpaid.

Also, realize whatever is best right now won't be in 10 years and you should always be evolving your skillset.

Also realize that best is very tricky and depends a lot on what you are doing.

My personal experience is Java, python,php and js. But I've gotten stuff done in ruby, cold fusion and .net.

Server wise node for js seems pretty standard. PHP has Apache mod-php which is well documented. If you are making an API I think php-fpm would be a good alternative although I usually run into issues when it comes to returning static content like images or css files. Still have not found a good solution for that without some hacky methods.