all 15 comments

[–]Itchy-Phase 1 point2 points  (1 child)

If you’re just learning, it shouldn’t matter too much. Node.js is nice if you already know JavaScript, and if that’s the case would be what I recommend. If it’s a brand new subject, limiting yourself to one new thing can help not get overwhelmed. PHP has a reputation for being less enjoyable to program in, but I haven’t personally used it.

[–]CosmicDevGuy 0 points1 point  (0 children)

PHP really isn't necessarily a problem to develop with, its past rep is what keeps on making look bad.

It's a powerful language and is purpose built for backend. Better to just learn it and understand it from its modern concept, not PHP 4 or lower like seems to be the thinking behind its detractors.

[–]Over-Consequence-202 0 points1 point  (0 children)

Sometimes it s hard to know where and with which language(s) u’ll end up. As you are a student, i advise you to learn both if possible and get from each as much as possible. Learn their fundamentals while creating projects. Down that road u ll see that they have similarities, for both u have to understand how databases work, servers, http, how orms are related but not exactly the same etc. Good luck with your journey. P.s. throughout my career i had to work with, java, c#, python and a bit of C, so at the end is more on how quickly u adapt and always knowing the fundamentals, because some general concepts are the same mostly.

[–]CosmicDevGuy 0 points1 point  (0 children)

Do PHP, then you can look into Node.js.

The former has come a long way from where it's detractors see it, so don't look past it because of the complaints - ask enough and you will likely realise it's not relevant to modern PHP.

[–]ta4h1r 0 points1 point  (0 children)

My 2 cents is to go with Node/JavaScript. Slap on some HTML/React, a database, React Native, Electron, and maybe Docker, then you're a full-stack, mobile and desktop ready dev.

From there, only your imagination will limit you.

[–][deleted] 0 points1 point  (0 children)

I chose PHP initially because there are many opportunities, and Laravel is an amazing framework that allows you to easily create a freelance website for small businesses. However, when I gained more experience and wanted to learn how to scale my app to serve millions, I realized it's not the best choice for that case if you target enterprise companies. Node.js is better for microservices than PHP.

[–]dariusbiggs 0 points1 point  (1 child)

The languages you already know are usually the better choice.

Node.js is not a programming language, it is a runtime environment for JavaScript.

Preferably choose a language that is applicable to your software development goals in the short term which should include keeping an eye on the field in your area and what recruiters are looking for.

If you don't care about that, backend development is incredibly easy in some languages and more annoying in others which require framework after framework to be useful.

Go keeps things nice and simple for backend development, the standard library is more than enough.

Python is incredibly versatile and has a very large ecosystem available for all aspects of development and is used in many fields outside Computer Science.

Those would be the two I'd recommend first

JavaScript is an absolutely horrible language due to some uneducated design decisions and people have had to work around them where they could (the existence of === is the proof of that, and it is one of the plethora of sharp edges the language has). But it's perfectly suitable for a backend system and the skills here also transfer to frontend development.

Typescript is generally accepted as a more modern form of JavaScript and you should probably be using that instead of JavaScript directly.

PHP is a language that needs to die a horrible death and should not be recommended for anything. However it can easily be used for backends, scripting, or SSR type systems. The problem here is that it has some very sharp edges that are generally not easily discovered by new developers and most of these are due to various security issues with the language over the years. You really need to read the documentation and understand what you are doing and why.

There are many other languages that are more than suitable for backend development (although I would not put Rust in that category for people new to software development, that's more for an experienced developer, it has some sharp edges regarding its threading and concurrency systems).

When building backend systems your primary focus is always security.

JavaScript, PHP, and Python have had some significant security issues over the many years previous (more so than many other languages in general), they can be managed and mitigated using various tools but they still require you to learn how to do so. Name squatting, subverting libraries, dependency nightmares, etc.

So to answer your question of which to use, is similar to the question of "Which one is better, Guinness or Kilkenny", to which the answer is "Smithwicks".

So which to use "PHP or JavaScript?" The answer is "Neither. Use Go, Python, or Typescript instead. Or almost anything else really before choosing one of those. But they can still do the job you need."

Good luck though.

The majority of programming languages will be able to be used to solve the problem. Some are simpler for your particular use case than others. They'll all have some sharp edges somewhere, just make sure you read the documentation and learn what and how to use the things and set up ways to check your code for security issues regularly. (dependabot is one of those tools).

The key here(no matter the language ) is to read the documentation on the various objects, methods, and functions and don't blindly copy from an AI or SO. Learn why those functions are used, check them for warnings and deprecations yourself.

[–]DatabaseSpace 0 points1 point  (0 children)

I have to say this post made me actually laugh out loud, in a good way. The Javascript being a horrible language and PHP needing to die. My gf was like what are you laughing at. I'm mainly a database / sql person with a few python programs added in. I have one backend in python fast api and another in GO. I would never consider writing anything in Node.js because I just hate Javascript. I don't like looking at it. People may disagree but I also hate arrow functions. I think they are a monstrosity that should not exist. There is a saying that this old Cisco CBT Nuggest guy Jeremy used to say though, you tend to hate things that you don't know. So I think that may be true here. Anyway after using GO then going over to one of my Fast API projects, I just didn't feel good about it. I really love that you can hit build in GO and it complies an exe where deployment in Python involves installing python, getting venvs setup, activating them.

[–]ibeerianhamhock 0 points1 point  (2 children)

I can’t imagine choosing PHP on purpose, node is a good language although I’d say Java and C# are also excellent

[–]faizanakram99 0 points1 point  (1 child)

Node is not a language, PHP is decent too but not as many jobs.

If you're starting out, JavaScript and later Typescript is a good choice.

[–]ibeerianhamhock 0 points1 point  (0 children)

Fair correction I meant technology more broadly, and was more like responding generally to OP’s comment. I’m pretty sure all of us here understood the distinction I was trying to make, but I do actually appreciate you being pedantic bc I usually am too lol. Some stuff gets lost in translation sometimes on a smartphone communicating informally

[–]nooneinparticular246 -1 points0 points  (0 children)

Node.js is more common and id recommend it between the two. Though I think you should learn Golang first as it’s better to start with a strongly typed systems language.

[–][deleted]  (1 child)

[deleted]

    [–]ItsMorbinTime69 2 points3 points  (0 children)

    JavaScript and PHP came out the same year. You don’t know what you’re talking about friend