23 votes

The ideal backend language to write web apps in 2023?

I know quite a controversial and opinionated question, one that might easily get blasted with downvotes on a site like StackOverflow or even Reddit! Nevertheless, one which I believe is still relevant to ask and useful one even in 2023.

The problem with backend web technologies is that we are overwhelmed with choices. Whilst getting spoilt with choices seems like a useful thing sometimes, it might easily be an impediment in decision making too. Based on my experience, there are a bunch of useful stacks and I will work on any of them if you pay me to work as a freelance coder. Each has its own pros and cons but I'm yet to find the ideal one which according to me is something that should be easy to code and deploy while also better performing at the same time.

  • ASP.NET: C# is the language I started coding web apps with in my last company and ASP.NET web forms was quite the rage back then. PHP was also gaining traction in the open source world and the webdev was mostly divided between the Enterprisey .NET aristocrats of Microsoft world and the poor PHP peasants of the FOSS world! One good thing about ASP.NET was performance. Since MS controlled the whole stack, they also put great efforts at making it work faster. The bad thing, of course, was dependence on a closed tech stack and a closed black box that generated JS functionality on its own.
  • PHP: When I resigned from that company and started freelancing, I came to know about open source, linux, XAMPP, etc. That was when I realized that my own attitudes and thinking was more attuned to the FOSS peasant mindset than the wealthy aristocrat's! I didn't earn quite as much in freelancing with WP, Drupal, SuiteCRM, CodeIgniter, etc. but I found great happiness and contentment in being part of the open source process. Till date, PHP remains my favorite language for backend development and most of my web projects involve CodeIgniter or even pure PHP.
  • Python: Flask is what got me interested in Python web development. The sheer minimalism and flexibility of that framework is what I found quite remarkable and quite a rarity in the frameworks world. And jinja2 template system was just fantastic. The other framework called django is more popular I think and I've worked on that too but Flask still remains my favorite. Flask is good in performance dept. too but I think it gets tricky once you start scaling with too many users.
  • Java: I've never really bothered with Java web development except a few tutorial experiments on the Apache TomEE server. The multi-layered approach that Java takes not only has very steep learning curve but unless you're a very gifted programmer, it's practically impossible to beat the performance of interpreted PHP/Flask!
  • NodeJS: Again, not much work here except brief hobby projects like http-live-simulator. The npm packaging system really turned me off initially with so many packages and issues with that system in the earlier days. Nowadays, I've heard that it's much usable but I've never gotten into it.

And now, we also have the evolving languages like Golang, Rust, etc. taking their baby steps towards web development too! Are any of them worth giving a try? If someone were to ask you for a backend tech stack recommendation while giving equal weightage to performance, developer productivity and ease of deployment, which one will you suggest?

20 comments

  1. stu2b50
    Link
    The beauty of server side coding is that you can use anything you want, since it's about the most primitive type of input <-> output machine you can make. That being said, prioritizing for...
    • Exemplary

    The beauty of server side coding is that you can use anything you want, since it's about the most primitive type of input <-> output machine you can make. That being said, prioritizing for different things:

    1. pure development speed - Python. Django + django-rest-framework for maximum dev speed, fastapi for something newer and cleaner. I'd definitely use the static typing system and mypy, though.

    2. ease of deployment - go or rust. It's hard to beat single binaries with all the dependencies statically linked. Go has a lower barrier of entry.

    3. performance - go or rust. Go can be slower because it has a runtime and sometimes the GC does weird things.

    4. bonus developer speed - elixir. Sometimes the actor model just makes your life incredibly easy, and makes scaling incredibly easy. That being said, it's a pretty esoteric language, and the lack of static typing hurts.

    5. bonus bonus developer speed - JS or TS with node or deno. I'd prefer TS with deno. If you're also writing a webapp as the frontend, being able to share code (not to mention, you can't get more first class json support than javascript) is quite a big developer productivity boost. Typescript is genuinely a quite well thought through language with modern features .

    26 votes
  2. happimess
    Link
    ASP.NET is a particular web framework that sits on top of some .NET projects. The modern dotnet stack has very nice cross-platform tooling that has a plugin for your favorite editor. It's easy to...

    ASP.NET is a particular web framework that sits on top of some .NET projects. The modern dotnet stack has very nice cross-platform tooling that has a plugin for your favorite editor. It's easy to get lost in outdated documentation, but that's true for a lot of languages.

    C# is a great language with some really sensible web server options, in the standard library and 3rd-party. F# is amazing if you like that sort of thing, and language interoperability is good.

    Golang has far more than "baby steps" into web development. The go templating language is sensible and feature-rich, and the standard library has REST routing and handling.

    That all said, I think our answer is right here:

    Till date, PHP remains my favorite language for backend development and most of my web projects involve CodeIgniter or even pure PHP.

    If it ain't broke...

    10 votes
  3. drannex
    Link
    The web world has grown a lot over the last decade, nearly every language has a highly performant web framework available (or a dozen). Go with what you are most comfortable with, if you want to...

    The web world has grown a lot over the last decade, nearly every language has a highly performant web framework available (or a dozen). Go with what you are most comfortable with, if you want to try something new, then Rust with something like Rocket.rs (hard mode), Python (normal mode), or Node.js (relatively easy mode).

    Overall though, I suggest Elixir with Phoenix, but that's a totally different paradigm than most people are comfortable with, but being totally different may be something you're interested in.

    8 votes
  4. teaearlgraycold
    Link
    I really like the elegance of using the same language (Typescript) in both the client and server. The node ecosystem is a bit wild, though. Less so on the back end. And you're already stuck with...

    I really like the elegance of using the same language (Typescript) in both the client and server. The node ecosystem is a bit wild, though. Less so on the back end. And you're already stuck with it for "modern" front end work anyway.

    You get little benefits from this - like never forgetting if it's .push() or .append() depending on the context. But also bigger benefits like being able to share code between both environments. Client side validation is easy and will always be in sync with your server code. This is because it can be literally the exact same code. Or little constants like COOKIE_NAME can be shared across both sides of the app. And on top of that you get all of the benefits of Typescript/Node. Great async support. The best dynamic type system in any language. Plenty of existing well-supported libraries (just gotta know how to filter out the bad ones when searching).

    7 votes
  5. dblohm7
    Link
    With respect, Go was never taking "baby steps" toward web development; Go is absolutely designed for web development, and I personally think that it would be my primary choice for a new web...

    And now, we also have the evolving languages like Golang, Rust, etc. taking their baby steps towards web development too!

    With respect, Go was never taking "baby steps" toward web development; Go is absolutely designed for web development, and I personally think that it would be my primary choice for a new web backend in 2023.

    7 votes
  6. opcode
    Link
    No love for Common Lisp? As a learning experience I wrote myself a little checklist/TODO webapp using a framework called CLOG. It's amazing how productive you can be with the right tools.

    No love for Common Lisp? As a learning experience I wrote myself a little checklist/TODO webapp using a framework called CLOG. It's amazing how productive you can be with the right tools.

    5 votes
  7. Akir
    Link
    I agree with @stu2b50. Do what you want. With that in mind, it seems like you're already comfortable with PHP, and I doubt that the ecosystems built on it will fall apart too quickly.

    I agree with @stu2b50. Do what you want. With that in mind, it seems like you're already comfortable with PHP, and I doubt that the ecosystems built on it will fall apart too quickly.

    4 votes
  8. nrktkt
    Link
    I think in 2023 the preference is to have a web client and a back end API. Although they might be in the same language and share data models, and the client might be rendered on the backend, and...

    I think in 2023 the preference is to have a web client and a back end API. Although they might be in the same language and share data models, and the client might be rendered on the backend, and any number of other variations.
    For true backend web like you’re talking about, I don’t think the ideal is any different than it was five or ten years ago (although there may be some new options, it remains fairly subjective).

    3 votes
  9. kroner
    Link
    I am currently writing a project with actix-web in Rust and I am pretty impressed with how fast it is, paired with Diesel for the ORM

    I am currently writing a project with actix-web in Rust and I am pretty impressed with how fast it is, paired with Diesel for the ORM

    3 votes
  10. [2]
    Shmiggles
    Link
    I'm developing a web service using some pretty unorthodox languages: Backend: C. I like C, I know exactly what's going on. I'm not using a framework, I'm providing my own HTTP handling right on...

    I'm developing a web service using some pretty unorthodox languages:

    • Backend: C. I like C, I know exactly what's going on. I'm not using a framework, I'm providing my own HTTP handling right on top of the BSD sockets API and an SSL library. I tried using Go, but the abstractions felt all wrong.
    • Database: SQLite. I know how the data will be partitioned between users, so I can shard the data accordingly into separate databases and keep the performance up that way. I tried using PostgreSQL, but the administration was just too annoying.
    • Frontend: HTMX. I like it conceptually, and I don't have to learn JavaScript.
    • Typesetting: LuaLaTeX. People who tried LaTeX and didn't like it didn't get deep enough into it to understand why it is the way it is. My project is centred on producing technical documents, and LaTeX is the only system up to the job.

    This is all very unorthodox, and I'm sure there will be a lot of people who will have all sorts of sensible reasons why this is a Bad Idea, but this is working well for me.

    3 votes
    1. m8y
      Link Parent
      I've used TeX quite a bit for user generated documents but found it quite fiddly with different modules. I did use SQLite for a little project as I thought having databases as tangible files was a...

      I've used TeX quite a bit for user generated documents but found it quite fiddly with different modules. I did use SQLite for a little project as I thought having databases as tangible files was a good idea but found it a nightmare for corruption issues.

      I do still write my CV in TeX though!

  11. [3]
    vord
    Link
    The world is your burrito. I was curious to see what other oddities exist. Fortran COBOL

    The world is your burrito. I was curious to see what other oddities exist.

    2 votes
    1. [2]
      Bauke
      Link Parent
      That Awesome COBOL list only links to projects in Go, I don't think it's legit. They search and replaced Go with COBOL, a few instances of "cobollang" and broken links (that get fixed by replacing...

      That Awesome COBOL list only links to projects in Go, I don't think it's legit.

      They search and replaced Go with COBOL, a few instances of "cobollang" and broken links (that get fixed by replacing cobol with go) definitely gives it away. :P

      3 votes
      1. vord
        Link Parent
        damn. I'll have to dig deeper. I have 0 doubts at least one exists.

        damn. I'll have to dig deeper. I have 0 doubts at least one exists.

        1 vote
  12. [3]
    EyeCon
    Link
    Nim is a new language which I think will lend itself to that, but there's much room for improvement. It must stabilize before it gets the attention and time investment from the people. The syntax...

    Nim is a new language which I think will lend itself to that, but there's much room for improvement. It must stabilize before it gets the attention and time investment from the people. The syntax is Python-ish and it compiles to C or JavaScript (experimentally WASM too if you jump through a lot of hoops).

    https://nim-lang.org/

    2 votes
    1. [2]
      petrichor
      Link Parent
      Well, 15 years "new" :-P There is a 2.0 release coming up, however.

      Well, 15 years "new" :-P

      There is a 2.0 release coming up, however.

      1 vote
      1. takeda
        Link Parent
        Well, python was considered new 10 years ago, even though it is older than Java that was dominating the field 20 years ago.

        Well, python was considered new 10 years ago, even though it is older than Java that was dominating the field 20 years ago.

  13. scruffles0
    Link
    i'm incredibly boring and i love safe framrworks, so for me, Django. My reasons: Batteries included: ORM, templating, authentication, authorization So many plugins! You can add social media sso...

    i'm incredibly boring and i love safe framrworks, so for me, Django.

    My reasons:

    1. Batteries included: ORM, templating, authentication, authorization
    2. So many plugins! You can add social media sso with one pip install and a bit of configuration. Or you can add API support via DRF. Or add OAuth2 support. Everything is a install away.
    3. Great community
    4. It's popular, which means that if you have a problem, it's quite easy to find a solution
    5. It's SUPER stable
    2 votes
  14. regularmother
    Link
    I'm surprised that no one has suggested Kotlin. Kotlin has Kotlin React and excellent backend frameworks via http4k, ktor, and of course everything from Java. Someone could feasibly write their...

    I'm surprised that no one has suggested Kotlin. Kotlin has Kotlin React and excellent backend frameworks via http4k, ktor, and of course everything from Java. Someone could feasibly write their frontend, backend, and android app in one language. With the upcoming Project Panama changes, I expect foreign memory interfaces with native libraries to also be much smoother. There's a GitHub repo with a zero-copy Python-Java bridge via numpy and structs so you could even go integrate PyTorch into there.

    2 votes
  15. LGUG2Z
    Link
    I built both Notado and Kullish on Rust (Rocket and Actix respectively) and Diesel (ORM). These days I would suggest using either Actix or Axum over Rocket, but honestly you can't go wrong at all...

    I built both Notado and Kullish on Rust (Rocket and Actix respectively) and Diesel (ORM). These days I would suggest using either Actix or Axum over Rocket, but honestly you can't go wrong at all with this set up. You probably don't need sqlx - if https://crates.io can serve the entire Rust ecosystem with Diesel, chances are you'll also be fine with it.

    Zero to Production in Rust is a great resource for this stack.

    This is the most productive I've ever been for writing backends. Rust is literally a superpower for the single developer.

    I strongly recommend that for a web app you stick to HTML templates, Tera is great for this and is supported by all major Rust backend frameworks. If for whatever reason you have to have a separately deployed TypeScript SPA frontend which communicates over a REST API (spoiler: you probably don't unless you're building something like Figma), you should generate TypeScript typedefs and API libraries from your Rust struct payloads; it's super easy with serde and you don't have to waste developer time constantly writing and updating an SDK in TypeScript just to be able to fetch and update data.

    1 vote