Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
C0D4669025yBoth, neither, depends on the circumstances and project.
Node is the trendy one, php is the tried and tested one that doesn't break every time you deploy it due to a random 15th party dependency. -
IDK, it depends what you need and what you feel more comfortable with. With NodeJS you can run your backend and it dosen't die after each request so if you need "state" you can have it, PHP can use only files and database for having "state".
Other than that I believe (but someone may prove me wrong) PHP 7+ is faster than node.js. Also it's up to your preferences, there is no such thing as better or worse per se. They are just different.
If you ask for my personal opinion? PHP.
E:
forgotten to mention that PHP is much more mature software which is a good thing. -
C0D4669025y@DubbaThony you could use sessions or memcache fo manage state between requests, but you're right, a database is typically used depending on what's going on.
-
@C0D4
Session is file.
Memcache is external program. You could even write yourself simple low-level app that can store your input and allow easy retrival. But it still will not be part of php itself. -
C0D4669025y@DubbaThony well yea I'm not disagreeing here, but given the options with php being stateless by its self, The only options are using a file of some kind or external cacheing system unless you write to a database.
@M1sf3t 😵you stole ma popcorn? -
@DubbaThony You can change the session handler and use a database, a Memcached server or whatever you want for storing session data. The session file handler is just the default.
-
inaba45895yI mean, try them out and see which ones you're more comfortable with. None of them are really best
-
C0D4669025y@Jilano 🤔I think I'm closing in on the whale you had before 😂
Ok I'll stop... just right after this bucket of 🍿 -
pingu895y@DubbaThony you're describing the difference between a CGI (or serverless) application and a full-fledged application.
Doesn't PHP has frameworks than run and are statefull already?
Well, to answer OP, I really don't like PHP but I also think it is more mature and you will find more resources for it.
If you go with Node.js, just pick a node+express tuto on udemy/youtube and you should be ready to go.
Actually, do it for both languages/platforms and decide by yourself! -
Nikhil1165yGo with node as it uses JavaScript and learning JavaScript would be great as a developer
-
Of the two, definitely Node.js (using TypeScript, fuck JS). PHP has the most retarded platform architecture imaginable
-
@ethernetzero
dude, I KNOW. With extensions or externall things (like database is kindda external to php itself) you can do anything. Im just pointing out that this is major difference that php process finishes execution of request and it's done, while with Node JS you can make it so it can persist this data in variable in memory between requests. -
PHP using PHP7. PHP 7.4 is coming and it's moving even further away from the shit that PHP5 was.
-
PHP is a programming language.
NodeJS is not a language itself, its a platform.
NodeJS is a platform which runs javascript on server-side and comes with some set of javascript functions, modules, helpers. Apart from that whatever logic you are writing is in JavaScript language.
To understand and learn programming and web development concept you should learn both PHP and Javascript and then you can Jump to NodeJS.
Check here further information or detailed difference between PHP vs Node.js: https://hackr.io/blog/...
Related Rants
PHP vs Node.js
Please give your valuable opinions as I am want to learn backend as soon as possible.
Which one is best for backend purpose?
question
#node.js
#php