When it comes to frontend development, every developer knows there's one language to rule them all: JavaScript (HTML and CSS are not programming languages). But when it comes to building backend systems, there are several languages efficient enough to get the job done.
In this relatively short post, I aim to suggest the best language to learn for a particular subset of backend systems, considering factors like scalability, security, and concurrency. That said:
This advice is primarily based on trends in existing organizations, so there may be objections. If you have any, feel free to share them in the comments.
Java
If you're building a backend system where scalability and resilience are critical, I recommend using Java. These factors are why Java is widely adopted in large-scale enterprise systems. It has been thoroughly battle-tested, powering large systems for companies like Amazon, Google, and Spotify (serving millions of users daily).
Python
If you're building backend systems that need to integrate well with AI, data processing, or machine learning (such as recommendation systems or data collection services), I suggest using Python.
Among the three main backend frameworks:
- Django: Best for enterprise adoption and scalability.
- Flask: Offers better integration with external libraries and tools (like TensorFlow and Matplotlib) compared to Django.
- FastAPI: Ideal for microservices and distributed systems due to its speed and support for asynchronous programming.
If you're a data scientist looking to create web applications, consider trying out Streamlit, which simplifies the process.
JavaScript/TypeScript
If you're building systems where the frontend and backend are closely coupled, TypeScript is a great option. Additionally, if you need to build and deploy something quickly (like an MVP), frameworks like Next.js, Astro, or SvelteKit are excellent choices.
Frontend web developers often lean toward this option due to their familiarity with JavaScript/TypeScript from building frontend systems.
C-Sharp
If you're building systems where security is a top priority, consider using C#. Financial applications and banking systems commonly rely on C# for their backends due to its robust security features, such as secure type safety and a wealth of libraries for cryptographic operations.
Rust/Go
- Go: Ideal for scalable microservices systems thanks to its efficient concurrency model and simplicity.
- Rust: Best suited for systems requiring low-level control and where performance and memory safety are critical.
If you're new to backend web development and unsure which language to choose, I hope this post provides some guidance.
Top comments (24)
The winner of your listing is Scala. Scala is a general purpose language which is scalable. Scala is easy to write and even easier to read. Because it's unit of code are expressions and not statements, it's predictable and so easy to debug. A program written in Scala is one ninth of the same Java program in LoC. Lower LoC means easier maintenance, rapid development and lower attack surface. JavaScript and Python are not typed languages, and everyone knows they are bad choices for large scale projects. Typescript's type system is trivial compared to the advanced type system of Scala. Go is a language for cloud and is not a general purpose language. Scala is preferred over Rust by anybody who favors intention over mechanism. C-sharp is the Microsoft response to Java, so it's always behind Java.
Scala compiles to Java bytecode and can be run on server, desktop and Android, Scala compiles to JavaScript and web assembly and is suitable for front end and web, Scala compiles to native machine code like C. So all the languages you named are beaten by Scala. Scala got the most ever advanced compiler in the world, so many of tasks done by developers in other languages is automatically done by Scala compiler and this is backed by real world proven case studies like Lichess.
Scala is a language which makes it easy to express patterns. So it already has the features of Haskell via Cats and Zio and Kyo, features of Erlang via Akka, features of Idris via incorporating dependent types in Scala3, better meta programming than Lisp or Clojure because of its principled approach to meta programming, provable soundness better than ML, a better choice than Coq for certified programming, type inference and structural types hence a better scripting language than Perl or Python, Elm's TEA pattern via Tyrian (not forget to say ReactJS is a joke compared to Elm) also is an object functional language more advanced than OCaml. And finally, Scala is the only industry-quality multiparadigm programming language, aka realization of oz designer dreams.
Java 11 successors new features are stolen from Scala, Kotlin merely is a rebranding of old Scala2 plus coroutines and a non principled null safety approach which makes it even a degraded Scala2. Akka is the best ever implementation of Actor model of computation and ported from Scala to Java, .Net and JavaScript. Even newer models of computation like Reactor model are implemented in Scala.
If you are going to be a life long developer, investing your time in any language other than Scala will be your worst professional mistake. Scala thrives while other languages are only kept alive by populist columnists.
Scala, especially Scala 3, is a very powerful language, but when it comes to general backend services, there are a lot of great options. Elixir and Erlang, for example, are strong choices for scalability and fault tolerance (I could probably write a whole paper comparing Akka with Erlang). Go excels at concurrency and is a great pick for rapid prototyping, while Ruby 3 brings solid concurrency primitives and its Rails framework to the table. Java and Kotlin are strong contenders as well, particularly with Spring, Boot, and Akka. Rust, with its frameworks leveraging macros, offers a good experience too.
The key takeaway is that each of these languages has its own strengths and ideal use cases. For smaller backend services that donβt need massive scalability, simple languages like Go, Python, or Ruby could be a better fit since they allow for fast prototyping. After all, if youβre building a simple REST API, you probably wonβt need the complexity of dependent types and type level programming. On the other hand, if youβre looking for something more enterprise-grade and battle-tested, any of the languages Iβve mentionedβor others not listedβcould be the right choice. Heck, there are even companies successfully using Common Lisp and fortran for cloud services. It really is a matter of use case.
Just fyi, I really like Scala and I've been working with it quite a bit since Scala 3 came out but as with any language it's just another tool in your tool belt as a software engineer. It's a really powerful tool with a lot of options, but sometimes the path of least resistance comes from something a bit more specialized.
Can you elaborate on why Scala has better meta- programming (if not overall better programming) than Lisp or Clojure.
A quick Google AI search result says this for "Is Scala dead?" :
"Scala is not dead, but its adoption has been declining for years. Scala is still used in many projects, but it may become a niche language if its current trajectory continues. ... "
I had elaboration there, probably you missed the point: "better meta programming than Lisp or Clojure because of its principled approach to meta programming". Clojure's and Lisp's approaches are too freestyle to be useful, even in Clojure community it's somehow discouraged. The ultimate decision by Scala designers, to not follow Lisp's approach, was because it dissects the community. Languages that lack comprehensive design and, kind of too freestyle (otherwise wrongly advertised as flexibility), end up requiring a benevolent dictator to control the dissection of the community. Lisp already is famous for endless dialects, and Clojure got its dictator in place. Scala's approach to meta programming is based on compile time manipulation of code ASTs, contrary to Lisp's approach, which is based on runtime in-line code transformation. Scala3 compiler creates formal ASTs, while Lisp code lines are interpreted by the programmer as nested list structures. Even Scala made a step forward and uses Typed ASTs, it means there is no type erasure before making the AST, which means more strong type safety. Scala3 is known for its dot calculus soundness proofs and formal verification. There could not exist such a soundness proof and formal verification for any Lisp-like language.
Not sure why are you looking for quick answers, I guess quick answers cannot fill the need for correct answers. After all, if you used to ask weird question from AI, you shouldn't blame it for surprising answers, but yourself. Anyway, I'd rather ask Google Gemini, for Clojure death if I were in your shoes.
So Java is still the king of enterprise level applications.... This is very nice article by the way.
I'm missing Ruby on Rails in your list, which is a great backend option
Yeah
I feel ruby on rails is mostly used to build generic backend systems.
I didn't see any special use case of ruby on rails.
But ruby on rails is a great backend language to learn
Ok, you are right, I missed that :)
I would say "If you are building system alone/in small team, and speed is of essence, Ruby on Rails is the best option". But it's different kind of "special use-case" then those used in this article.
OMG, You missed Laravel π€¦
Backend frameworks like Laravel Ruby on Rails are primarily used for generic backend systems. It is challenging to specify the exact type of backend systems for which they should be utilized.
Laravel is a framework and Ruby on Rails is a framework. Laravel uses PHP as the programming language and Ruby on Rails uses, well, Ruby as the programming language.
If you are building a backend for a small company, who already have a website and some web hosting provider. Pick PHP.
C lang for Libraries
Go lang for Microservices & APIs
Python for Graphs, Maps, & Data Analysis
PHP for Blogs & Wikis
Zig for portability (write once, run anywhere)
ββββ
VM languages such as Java & Javascript need VMs (JVM & V8) to run, impacting resource efficiency.
M$ funded languages, such as F#, C#, .htm expires when Bill Gates founded telemetry company decides it is no longer useful for gathering telemetry on users.
ββββ
...Haven't tried Scala yet
Well written from my point of view,
Thank you for your efforts.
No mention of Web Assembly for which there are many language transpilers, so even on the front end you can use many languages. See github.com/appcypher/awesome-wasm-... for one list.
I've personally not really looked a lot into wasm
great suggestion!!!
Schrodinger's cat, lol :D
F# is always a good option if you want to use the functional programming paradigm in your backend.