Ask HN: Should I switch from PHP to NodeJS? - vsakos
======
munimkazia
PHP and Node.js happen to be the two languages/platforms I am most proficient
with. I don't think one can be completely replaced by the other for all
situations. It really depends on what you are planning to do with it. If you
use PHP to develop websites/apps and you aren't facing issues with
scaling/load, you can continue with PHP, which has a bigger ecosystem compared
to Node.js.

If you want to deploy a real time app or a socket or tcp server, or even a
high load API, you can give Node.js a shot. Node.js can do normal web stuff
too, but I don't know any good reason why you would want to learn and use it
when you are already proficient with PHP.

For the sake of simply learning it, just go ahead and learn it.

------
workhere-io
Unless you have a job offer that specifically requires you to use Node.js,
it's not really a question of "switching" \- it's more a question of adding
Node.js to the list of frameworks you know.

As far as jobs go, outside of Silicon Valley it seems that there is still a
huge market for PHP programmers, and those Drupal/Joomla/Magento/WordPress
sites aren't going away any time soon.

I'd also recommend Python, which many PHP programmers instantly like. Getting
started with Flask ([http://flask.pocoo.org/](http://flask.pocoo.org/)) should
be fairly easy. Several big sites like Instagram and Pinterest are powered by
Python.

------
sbahr001
Everyone is right. Learn both, remember each of these are tools. Once you
learn them well you will know which is a better tool for what you are doing.
Here is a real-life example from my experience: Project was built with
PHP(MVC) and Ngnix(Apache alternative). Node.js was used for a real-time chat
and comment system, previous used PHP. \- Note Node.js is so much more but for
the project it was easier to implement with node.js, and worked a lot better,
than the previous php implementations(for us). I hope this helps.

------
czbond
Without context, we it is hard to say. What are you developing, for whom, and
why? If you're a solo developer, the answer is different than if you're an
agency or startup. What types of products are you creating? Are you worried
about pay [eg: php developers usually have a lower rate than hourly or js].
Can you provide more context?

~~~
vsakos
i'm a solo developer (still a student, so i don't get much time for coding). i
see that node is growing fast and i just want to know is if it's worth using
instead of apache+php, and can it be a 100% replacement.

~~~
czbond
Thanks that helps a lot. PHP is pretty good language to start with. I do agree
it is worth adding to your toolbox. I personally have moved to it because it
is where the future of the web (i believe) is going. Real time, web socket,
internet of things (devices) all integrate with the node use case well. PHP is
good for web dev, but node is transitioning to allow one to go far beyond web
development. I believe that if you want to be a developer, your skill set and
pay rate coming out of school will be much higher if you have significant node
experience rather than significant PHP experience.

------
27182818284
Don't switch existing apps to it unless you have a good reason, but knowing
PHP _and_ Node makes your resume look better than just PHP.

Also it is always great to try new paradigms as they open minds more. So
double yes for that reason I guess.

------
chany2
Going to the same situation. I decided on NodeJS vs Ruby on Rails or Python
because I am mostly a front-end engineer; so advancing in JS skills is good.

There is a lot of PHP resources on the web; so I don't have you have to give
it up.

------
krapp
I think a better way to frame this question would be "should I include NodeJS
in my repertoire?" And I would say "sure, why not?"

------
jordsmi
It really all depends on what you plan on working on. Really I would suggest
any of the frameworks over plain PHP... rails, django, etc

------
c2u
PHP is great, but for beginner nodejs is better. If you are very good at PHP,
you don't need to.

