Choosing which programming language to use for a project is important. Some of the questions you’ll want to run through are:
- Where will the application be run, and which languages are supported in that environment?
- Do I already have knowledge of one of the languages being considered?
- What does the application need to do?
- Are there any good frameworks or libraries that will do some of the legwork for me?
PHP Coding on the Server Side / Backend
PHP is a preprocessing language. It prepares pages of HTML code or other data and then sends them to the user’s web browser. It is server-side only.
It can not respond live to clicks, button presses, touches, or mouse movements. It can just receive a request (a link pressed, a page request, a form submitted) and return a document based on that request’s contents and any processing undertaken before the request was returned.
For example, PHP is designed for API backends or applications where users submit and read data.
PHP could be used to receive a search request and return the relevant database records on a new page, but it could not be used to respond to the user pressing a key on the keyboard or display a pop-up.
This isn’t really a bad assessment.
However, it’s good to know more than one programming language, and PHP shouldn’t be discarded straight away – there are a lot of good libraries for PHP, and your hosting environment might only support PHP.
Additionally, your app idea might require interfacing with something like WordPress or some other service built with PHP – so it may have an advantage through that.
Anyway, back to Node.js.
Look, it’s never really possible to straight-up recommend a programming language, platform, or framework for a particular project without knowing the brief for the project.
If you’re just looking to experiment and learn, it’s really a matter of user preference – read some documentation – look at some example projects on GitHub and see which code looks most readable to your eyes.
Once you’re familiar with one language, others become easier to understand, and you can start learning those too and forming your own preferences.