The best programming language in 2021

programming setup

Do a Google search for "best programming language" and you will be overwhelmed with opinions and firmly defeneded positions for every language you can imagine.

Every language has it's pros and cons. It's important to be able to take a step back and choose a language or languages based on what you are trying to accomplish.

So how do you choose?

Let's start by asking some questions:

  • Are you already comfortable in a programming language?
  • Do you work alone or on a team?
  • Does your team consist of full-stack developers or are they split between frontend and backend?
  • Will your project use mostly static or dynamic data?
  • Does your project have the same set of features or functionality for all users, or does it adapt based on user context and to what extent?
  • When it comes to hosting your project, do you have experience hosting this language or this type of language?
  • Do you need to integrate third-party APIs and what language integrations do they support?
  • Do you have other projects you are working on or still supporting?

Are you already comfortable in a programming language?

If you are already comfortable in a particular programming language, is there any reason that you can't accomplish what you are trying to do?

Do you work alone or on a team?

If you work alone, you have more freedom to choose a new language, but don't just choose a new language because it's trendy.

If you work on a team, you need everyone on board to make a major change like choosing a new language. If the pros don't outweigh the cons for everyone it can be very challenging to make the switch, and you may end up leaving people behind that are not comfortable switching.

Does your team consist of full-stack developers or are they split between frontend and backend?

If your team is split between frontend and backend developers, then mixing languages isn't really an issue.

FrontendBackend
React (Javascript)PHP
Vue (Javascript)Python
Angular (Javascript)Node.js (Javascript)

If your team consists of full-stack developers, then consider using the same language to reduce context switching.

FrontendBackend
React (Javascript)Node.js (Javascript)
PHPPHP

Will your project use mostly static or dynamic data?

If your project is using mostly static data, consider a static site generator like Gatsby to reduce server load.

If your project is mostly dynamic data, you will see very little difference in server load between a languages like PHP or NodeJS on a single server, but NodeJS might be easier to scale.

Does your project have the same set of features or functionality for all users, or does it adapt based on user context and to what extent?'

Depending on how drastic your feature set disparity is between users, a micro-site setup might be ideal. React or Vue frontends are easy to deploy on static site hosting.

When it comes to hosting your project, do you have experience hosting this language or this type of language?

Different languages function on different princliples when it comes to hosting. Do you know the difference between single and multi threaded languages and how to scale them?

Most legacy web hosting services focus on PHP or .NET based hosting.

Thankfully, there are a ton of new options for managed hosting services:

  • DigitalOcean App Platform - Node.js, Phython, Django, Go, PHP, Laravel, React, Ruby on Rails, Gatsby, Hugo, Docker, static sites
  • Netlify - React, Gatsby, Vue, Next.js, static sites
  • Vercel - React, Gatsby, Vue, Next.js, static sites

Do you need to integrate third-party APIs and what language integrations do they support?

Sometimes languages or frameworks on the bleeding edge just don't have enough widespread support to make them worthwhile in a production setting.

Do you have other projects you are working on or still supporting?

Context switching can be a major slow down in your development process. The time savings of a more opinionated language or framework can become irrelevant if you are switching context too often.

In conclusion

It can be tempting to try a new language because everyone is talking about it. You might feel like you're going to get left behind if you don't learn the latest and greatest language or framework.

My recommendation is to switch when you get to a point that you are no longer able to accomplish something in your current language.

Patterns in software engineering are more important than language specific features.

Something that I find helpful to remember is that the core of web development in 2021 is still HTML/CSS/Javascript. A framework should make development easier by making things repeatable and easy to manage, but it all compiles back to HTML/CSS/Javascript.

What has been is what will be, and what has been done is what will be done, and there is nothing new under the sun. - Ecclesiastes 1:9