Choosing a programming language for a new project

How the problem, the team and the ecosystem decide it, with a short guide for web, back end, mobile, data and systems work.

Lists of the best programming languages are written as if there were one answer. For a real project the language is chosen by the problem, the people and the ecosystem, in roughly that order. This is how we would think it through for a new build.

What actually decides it

  • The platform. A browser runs JavaScript. An iPhone app is most naturally Swift. Some choices are made for you.
  • The libraries. The best language for a task is often the one where the hard part is already solved and maintained.
  • The team. A language the team knows well will beat a theoretically better one they are learning on the job.
  • Hiring. Someone will maintain this in five years. Can you find them?
  • Operating constraints. Memory limits, start-up time and response-time targets rule some options in and others out.

Raw speed is on this list less often than people expect. Most business software waits on a database or a network, and the language is rarely what makes it slow.

Web front end: TypeScript

For anything beyond a small script, TypeScript has become the default for browser code. The types catch a class of mistakes before the code runs and make large refactors safe. It adds a build step and some learning, which a project of any size repays quickly.

Back-end services

  • TypeScript on Node.js. One language across the stack, a huge package ecosystem, and good for services that mostly wait on other systems. Less suited to heavy computation.
  • Python. Quick to write and read, with strong frameworks. The natural choice when the service sits close to data work or machine learning.
  • Java or Kotlin on the JVM. Mature, fast, with excellent tooling and a deep pool of experienced engineers. Common in large organisations and long-lived systems.
  • C# on .NET. Comparable strengths to the JVM, and a natural fit where a company already runs on Microsoft tools.
  • Go. Simple, compiles to a single file, starts fast and handles many connections well. A good fit for network services and infrastructure tools.

Any of these can run a successful product. The differences between a well-built system in one and a well-built system in another are smaller than the difference between a team that knows its tools and one that does not.

Mobile

Swift for iOS and Kotlin for Android give the fullest access to each platform and the most polished result. A cross-platform framework, such as Flutter with Dart or React Native with TypeScript, shares most of the code between the two and suits many business applications well. The trade is some extra work whenever a feature depends on something platform-specific.

Data and machine learning

Python, because that is where the libraries are. SQL belongs here too. It is decades old, it is not going away, and a developer who writes good SQL will solve many performance problems that no application language can.

Systems and performance-critical work

Rust offers the speed of C and C++ while preventing whole categories of memory errors at compile time. It is harder to learn and slower to write, which is the right trade for a database engine, a browser component or an embedded device, and usually the wrong one for a web application with ordinary load. C and C++ remain essential where a large existing codebase or a hardware vendor’s tools require them.

Common mistakes

  • Choosing a language to learn it. A paying project is an expensive classroom.
  • Choosing for a scale you do not have. Design for the next order of magnitude, not the one after that.
  • Using several languages without a reason. Each one adds build tools, libraries to keep updated and knowledge that must exist on the team.
  • Rewriting in a new language to fix a problem that is really about design. The same design in a new language has the same problem.

For someone starting out

Learn one language properly before sampling many. Python or JavaScript are good first choices because results come quickly and both are widely used. Then learn a second language that works differently, for example one with static types if your first had none. The second is where the concepts that transfer, such as data structures, testing and how to read an error, become clear.

Add SQL early. Almost every job involves a database.

A short guide

  • A web application with a small team: TypeScript throughout.
  • A product built around data or models: Python, with TypeScript for the interface.
  • A large, long-lived business system: Java, Kotlin or C#.
  • High-throughput network services or command-line tools: Go.
  • Software where memory and predictable speed are critical: Rust.
  • Mobile apps: Swift and Kotlin, or one cross-platform framework if the app is mostly forms and lists.

Then choose the one your team can run confidently. A boring, well-understood stack that ships is better than an ideal one that stalls.