7 votes

Does node.js have a future?

I've been toying with the idea of adding node to my arsenal of programming skills but unable to decide if the payoff is worth it in the long run.

Right now, PHP+Bootstrap suffices most of my needs when it comes to app development as a freelancer. As for JavaScript, I've always treated it as a language meant for client-side scripting and nothing more than that.

Now, as much as Node and npm narratives have become the biggest chatter of the day, I'm still not sure how much of that really translates into jobs or freelance projects or even real world industrial usage for that matter.

As far as I know, about 80% of the web is still powered by PHP and while JS certainly tops the TIOBE index, we don't know how much of it can be attributed to Node.js and how much to frontend JS technologies like jquery and react?

There is no doubt that for many folks, npm has become a critical part of webdev toolchain today (though the actual utilitarianism of some popular libs like babel and webpack is questionable IMHO). But when I compare Node with the established "run of the mill" languages like PHP, Python or even Ruby, what Node really lacks is proven works and street cred. Where is the node's equivalent of say sqlalchemy or rails or flask or laravel? Are there standard database drivers to access mysql or mssql or sqlite, for eg? Where are the open source folks in Node.js producing equivalents of WordPress and Magento and Drupal?

And what about the enterprise usage? The big ones are all obviously wedded to either Microsoft's .NET or Oracle's Java stacks. But among the smaller startups, how much mindshare do you see Node getting where it already has to compete with these other languages?

I understand that at a theoretical level, the event based async threading model of Node.js is truly innovative and since most typical CRUD apps spend most of their time waiting for an sql query to perform or network resource to be fetched, async should be the hot cake compared to synchronous programming. But that doesn't work out in practice for some reason. If that really were the case, 80% of web apps would have been powered by Node instead of PHP today, right?

12 comments

  1. koopa
    Link
    This all sounds like news to me, where I’ve worked Node has always been the default language on the server (or ts-node in recent years for Typescript) but I’ve mostly worked small teams that...

    This all sounds like news to me, where I’ve worked Node has always been the default language on the server (or ts-node in recent years for Typescript) but I’ve mostly worked small teams that require everyone to work full stack so JavaScript on the backend is a big selling point.

    The 80% number sounds kind of too good to be true and I’d imagine the vast, vast majority of that is simply Wordpress. I would be very interested to see what the breakdown is with Wordpress removed.

    Where is the node's equivalent of say sqlalchemy or rails or flask or laravel?

    If you’re looking for a batteries included library for Node you’d probably go for something that fully integrates with your fronted like Next.js that is built on top of Node.

    Are there standard database drivers to access mysql or mssql or sqlite, for eg?

    I use mysql2 every day which has 2.5 million weekly downloads.

    Where are the open source folks in Node.js producing equivalents of WordPress and Magento and Drupal?

    I believe Ghost was built with Node.

    20 votes
  2. skybrian
    (edited )
    Link
    I don't know about jobs. Within the JavaScript ecosystem, Node is older, but very well established and that's unlikely to change soon. There are important tools built on it. This includes all...

    I don't know about jobs. Within the JavaScript ecosystem, Node is older, but very well established and that's unlikely to change soon. There are important tools built on it. This includes all Electron desktop apps, which embed Node.

    Node is also important because it powers development tools used to build client-side browser apps. So, even if a team's server-side code is written in Java, they might have a web app written in React or some other framework like that, so they'd use Node to build the app, run tests, and so on. (I expect that using multiple languages on the same project is more likely with enterprise work.)

    There are newer, smaller alternatives like Deno and Bun that some people use too (Deno is my favorite), but it's still part of the same ecosystem since you're still using the same language and many of the same libraries (most often packaged as npms, which are a Node thing).

    I expect it to be around forever, even if it's no longer fashionable and some other JavaScript runtime takes over.

    18 votes
  3. smores
    Link
    My experience is like @koopa’s; working at the NYT, for example, there were several teams that defaulted to Node.js for backend development. It’s actually somewhat funny; working on Storyteller,...

    My experience is like @koopa’s; working at the NYT, for example, there were several teams that defaulted to Node.js for backend development. It’s actually somewhat funny; working on Storyteller, my open source project, I first wrote the backend in Python (because the Whisper implementation I wanted to use is in Python), and eventually switched it to Node.js anyway because the ecosystem of third party libraries is just so much more robust and well maintained.

    It seems like maybe you’re less involved in the Node.js dev community, which is totally fine, and so aren’t as aware of some of the very popular and well liked libraries and frameworks there as you are in other spaces. It’s also worth noting that Javascript is fundamentally a different language that Python, Ruby, and PHP, and became widely popular at a very different era of software development, and so its libraries and frameworks lean into different aspects of software development than those of its predecessors. There is no widely used, literally-everything-you-could-dream-of monolithic MVC framework like Django or Rails because that’s not how most Node.js developers prefer to design systems.

    That said:

    Express.js is the backbone of Node.js API development, and has been around truly forever. It’s comparable to Flask in basically every respect.

    There are plenty of large, well maintained MVC frameworks as well, they just aren’t as popular among Node.js devs, as I mentioned. Personally I’d much prefer, say, building my backend with PostGraphile than with Ruby on Rails (and I cut my teeth on Rails!).

    There are of course bog standard db drivers for every database there is (though sqlite support is a bit of a nightmare). The postgres driver has five million weekly downloads!

    And there are truly outstanding options for both headless and fullstack CMS-based website development. @koopa already mentioned Ghost, which is indeed a Node.js self hosted and customizable publishing platform; there’s also Strapi, an open source headless CMS, and any number of popular and well maintained static site builders. These vary from Next.js, which is a full stack React framework that does way more than static site building, to Gatsby, Eleventy, and like… quite a good many more.

    On the idea of not being sure how many people even use Node.js for backend development, consider that Express has 30 million weekly downloads on npm, and is exclusively a backend development library!

    10 votes
  4. [3]
    bl4kers
    Link
    Freelance work heavily skews toward PHP and WordPress, yeah? I've always been full-time and have yet to hear anyone at any employer of mine (track record: mega corp, small consultancy, acquired...

    Freelance work heavily skews toward PHP and WordPress, yeah? I've always been full-time and have yet to hear anyone at any employer of mine (track record: mega corp, small consultancy, acquired startup in medium corp, small startup) talk favorably about PHP let alone want to use it. Node on the another hand is constantly being pulled in, is well regarded, and this is the first time I've encountered someone questioning its reputation or long-term validity. Just my anecdotal report.

    I have some personal projects using PHP and feel pretty neutral about it. Though as far as reputation goes I'd put more stock in StackOverflow's annual surveys than a nebulous "80% of the web" statistic. A good chunk of the web is abandoned, no?

    9 votes
    1. [2]
      supported
      Link Parent
      Yeah, modern PHP8 is every bit as powerful and structured as you could want. But of course reputations stick around for a long time and PHP4 has a reputation.

      Yeah, modern PHP8 is every bit as powerful and structured as you could want. But of course reputations stick around for a long time and PHP4 has a reputation.

      2 votes
      1. Macha
        Link Parent
        I'll be honest, been doing some Laravel work lately and I'm sorely missing the JVM stack. Sure, many of the criticisms of the 90s are partially solved, but also there's new ones. Like I'm really...

        I'll be honest, been doing some Laravel work lately and I'm sorely missing the JVM stack. Sure, many of the criticisms of the 90s are partially solved, but also there's new ones. Like I'm really missing a Jackson equivalent with how much boilerplate code I'm writing to process web requests into objects in Laravel, and the module system has taken a bit too much inspiration from C++.

        2 votes
  5. Macha
    Link
    I'm not sure how much that is true these days, to be honest. And certainly even when it was, most of that was wordpress installs that were set up once and maybe maintained a couple of hours a...

    80% of the web is still powered by PHP

    I'm not sure how much that is true these days, to be honest. And certainly even when it was, most of that was wordpress installs that were set up once and maybe maintained a couple of hours a year. If you're a small scale or solo web contractor, maybe that's where you want to be, but most of the jobs are in the larger projects where there's 10s or 100s of full time developers.

    From where I'm sitting, Node has a lot of penetration into the enterprise space. Java is obviously first, but Node and .NET are duelling for second place. Python is 4th, largely data science though you can do web stuff in it. And PHP and Go competing for 5th in my local region.

    But it's probably worth emphasising that this is highly regional. Go to SV and Go is up and .NET and PHP are down. Go to continental Europe and .NET and PHP are up. Get into the games or embedded space, and suddenly it's C++ that is everywhere.

    6 votes
  6. [2]
    tauon
    Link
    Video: Why Don't We Have A Laravel For JavaScript? While I definitely don’t agree with everything that Theo’s saying here, it has some interesting points made and is worth the watch, imo.

    Where is the node's equivalent of say sqlalchemy or rails or flask or laravel?

    Video: Why Don't We Have A Laravel For JavaScript?

    While I definitely don’t agree with everything that Theo’s saying here, it has some interesting points made and is worth the watch, imo.

    4 votes
    1. pyeri
      Link Parent
      Thanks for putting this out, he seems to be making some really good points. It's not like these popular frameworks in other eco-systems lack rivals though, there is a strong competition to Laravel...

      Thanks for putting this out, he seems to be making some really good points. It's not like these popular frameworks in other eco-systems lack rivals though, there is a strong competition to Laravel from not just Symfony but even other frameworks like CodeIgniter, Falcon, etc.

      I don't know much about the Ruby world but it's a very small niche and community. But again, in Python, Flask, Pyramid and Django had solid competition for ages but now, there is even a third kid on the block called FastAPI!

      1 vote
  7. hobbes64
    Link
    Well I don't know much about industry-wide trends but I work for a fairly large company and most recent development that I've seen is in node. In my local team we use it in three different ways:...

    Well I don't know much about industry-wide trends but I work for a fairly large company and most recent development that I've seen is in node. In my local team we use it in three different ways:

    • Services that run in kuberntes containers
    • Aws lambdas
    • Client-side tools that are often run in Jenkins jobs

    There are alternative languages for each of these things, but node works very well and is very pleasant to work with as long as you use decent tools to help lint, scan, and automation test, which you should be doing anyway. It's also helpful that the UI devs are using javascript (sometimes typescript, sometimes vanilla) so front and backend are at least somewhat familiar to everyone.

    In the years before I used java and c#/.NET, then I did node for a few years. Then I had to return to java and I absolutely hated it. I guess I got spoiled by the ease of using dynamically-typed language, and java has a baffling habit of throwing everything in a stack trace except what you need to fix a problem.

    3 votes
  8. supported
    (edited )
    Link
    I wish to god someone would build a PHP equivalent for compiling and minifying JS and CSS. No one ever has. No one ever will. (composer is a less than partial solution) Anyways, NodeJS will always...

    I wish to god someone would build a PHP equivalent for compiling and minifying JS and CSS. No one ever has. No one ever will. (composer is a less than partial solution)

    Anyways, NodeJS will always be with us for better or worse (definitely worse)

    2 votes
  9. ButteredToast
    Link
    As someone who largely exited the webdev space back when Rails was still popular, if I were to return I'm not sure Node would be my first choice. There's so many good options now that the only...

    As someone who largely exited the webdev space back when Rails was still popular, if I were to return I'm not sure Node would be my first choice. There's so many good options now that the only reason I'd pick Node personally is if it were a project requirement for some reason or another.

    Not sure about jobs, though. There's probably plenty of Node jobs. That said, once again if I were to try to shift from desktop/mobile client dev into backend I'm not sure I'd want to be married to Node positions specifically.

    2 votes