3

should i learn both between php and node js for my backend ? or only choose one

Comments
  • 4
    Node js. Php is old and messy.
    (well node is also messy but younger and has a bigger community these days)
  • 3
  • 3
    one and is node
  • 4
    @react-guy Ooff. Wait until the PHP guys come on to berate you ;)
  • 1
    @AlmondSauce one could say some people say javascript should not be used for everything while php is intended for backend, but whatever *ducks and hides
    don't know about the huge community @react-guy said though. maybe this is a good advice. i am an old fashioned amateur tbh.
  • 2
    @erroronline1 I'm pretty agnostic on these things, I just like watching everyone else argue 😁
  • 4
    If your target is to create something and choices are limited to those 2, I’d say go for react: php is an ugly mess with some objectively stupid things... on top of that nodejs with typescript has a more reliable typing than php.

    Does this mean php is useless? Heck no, it’s used by a lot of companies and it is still a viable option!

    In faaaact... if your aim is to work for a company try both, see what you like the most and commit learning it well. Also make a couple of market researches looking at what the companies you like use and at what pays you the most given what you like to do!
  • 2
    Node. It can be nice to use JS all the way through. I use both - and I can tell you that PHP _has_ improved, but it might leave you with bad habits. Node is more professional anyway.
  • 3
    We have the usual - senseless, dumb, pretty useless - discussion of JS fans who don't know PHP vs PHP fans who hate JS. :)

    Please. Both sides suck.

    A lot of things stated here as facts are bogus, e.g. PHP has an extensive typing support in PHP 8.

    SSR / Server side rendering in JS isn't easy. It requires a lot of know how, especially when you want it to be _good_ .

    Same for PHP.

    A lot of FUD is spread here on devRant when it comes to programming language discussions - just do what you like.

    Important in my opinion is to understand _how_ the backend works.

    If you go for server side rendering, don't skip the vital background information on e.g. protocols like TCP / HTTP / TLS and how it works.

    A _good_ setup is one you understand and trust - as you know what's happening and can proof it by e.g. monitoring / traffic analysis / logging.

    It doesn't matter which language you learn in long term I think. It's more important to gain experience and knowledge and understand how a backend with all of it's components works.

    A programming language is only one component - that might change dependent on needs.
  • 0
    NodeJS or something proper like .NET
  • 1
    If you haven't learned yet, it's better to use something other than PHP, node is easy and you can write cool stuff, use Typescript for your own sanity.
  • 0
    @IntrusionCM more reliable != php doesn’t have one.

    But sure, php8 got some shiny great types, callable for instance... Passing function names instead of functions is clearly big brain.
  • 0
    @piratefox this is the part I meant...

    We have this discussion every few days.

    It's the same shit show every time.

    I didn't mean your post specifically btw.

    But saying that NodeJS is great, which runs JavaScript in a sentence with "TypeScript" is already funny.

    TypeScript was invented to overcome the shitshow that JavaScript is.

    :) In a nutshell the sentence is: You need a platform for JavaScript which runs another platform to run Typescript atop as JavaScript sucks.

    Now that's big brain stuff?
  • 0
    @IntrusionCM
    Curious that you mentions types but didn’t mean the only post speaking about them.

    Your logic is flawed af btw...
    1) Typescript is not a platform
    2) php would benefit a lot to have a language above it to compile into optimised code as well as any other interpreted language. Cause surprise surprise one of the core functions of a compiler is to optimise code.

    :) in a nutshell your attempt to generalise is: “everything which is built on top of anything automatically makes the base thing bad.” So idk go complain about refined metal not being able to do what you tell them unless you built a computer out of it.

    So please, stop trying to generalise or to hide mentions you did :)
  • 0
    @piratefox again very funny comment.

    I didn't generalize at all....

    Typescript itself requires an transpiler /compiler, so it is a platform.

    Node JS is a platform.

    No generalization, only facts.

    And it is a fact that JS sucks. It has several major flaws. Like PHP. And many other languages.

    TypeScript extends and tries to work around one of the major flaws, the typing system of JS.

    The rest of the comment... Ouch.

    Just ouch.

    As I said. We had countless discussions on devRant before. I'm here since 5 years I think.

    Don't get pissed because someone else has a different opinion ;)

    And a transpiler needs to be executed.

    Just because the transpiler generates optimized scripting language doesn't mean it's good.

    Quite the opposite actually... It's a lot of overhead.

    Having a language sitting on top of a language is usually a bad idea TM.

    Reason why asset generation became so important in JS.

    It's all about pre-compiling so the whole shenanigans necessary to run e.g. TypeScript / JS poly fills / Browser support in a minimized, optimized way.

    Which takes a lot of time.
  • 0
    @IntrusionCM whatever makes you happy, dude.

    Just try to be less on the defensive when you throw rocks and hide the hand afterwards. Makes it less obvious.
  • 0
    @piratefox There is nothing obvious here except your paranoia. :)

    And I didn't try anything at all.and I didn't throw any rocks.

    I'm just posting my opinion.

    *have a 🍪 and start to calm down, you really need it*
  • 0
    @IntrusionCM sure buddy. But keep your cookie, to me it looks like you need it way more than me.
  • 0
    Learn both, join team and use what they use.

    I personaly prefer nodejs for small stuff.

    I do not find value in Typescript however, if you want types, choose Purescript which is better typed language and syntax is clean.

    Small stuff, nodejs = speed

    Complicated stuff or stuff which favour FP -> Purescript = maintainability
  • 0
    Have a go at both and see which one feels more comfortable/natural to you.

    I don't know what the market for backend devs prefers in your country, so I can't really help with that.

    If you already know JS, Node.js would be easier to pick up.
Add Comment