How do you know when to use which programming language?

11 February 2024
Question

Hi, My name is Alex. I just graduated university, I'm confused, how do I choose a programming language for a job? Does it matter? Will I be assigned a programming language? Thanks for the help.

Answer

Hello Alex,

Congrats on graduating. So the question you’re asking is very vague, but I’d like to help you out as some have helped me out before when I was in your place. Remember, every great developer was once where you are now, full of questions and brimming with potential.

The essence of choosing a programming language lies not in seeking an objective “best” option but in finding the right tool for the job at hand. It’s a decision that is a combination of: technical requirements, personal preference, and the support of a vibrant community. These are just some of the factors to consider, there are many more, but you can think of these as pillars that will support your project.

Other factors might include, scalability requirements, hiring perspective. The software that you deploy on a moon rover, are different than those that you deploy with high-frequency trading bots. In the business world, the choice of programming language often extends beyond YOUR personal preference and YOUR technical suitability. It encompasses considerations of time-to-market, developer availability, and long-term maintainability of the project.

Example 1: Startup Environment

Imagine you’re part of a startup that’s working on an innovative web application aimed at revolutionizing how people manage their personal finances. The team is small, agile, and needs to move quickly to validate the business idea. In this scenario, a language like JavaScript, with its vast ecosystem and frameworks like React or Vue.js for the frontend and Node.js for the backend, could be an ideal choice. JavaScript’s ubiquity means finding developers is relatively easier, and its full-stack capabilities allow for rapid prototyping and iteration, which is crucial for a startup looking to pivot quickly based on user feedback.

Example 2: Enterprise-Level System

Now, consider an enterprise developing a high-frequency trading platform where performance, low latency, and reliability are paramount. Here, languages like C++ or Java might come to the forefront. C++ is renowned for its execution speed and fine-grained control over system resources, making it suitable for systems where performance could mean the difference between profit and loss. Java, with its robust ecosystem, scalability, and well-established patterns for enterprise applications, offers a balance between performance and ease of development, especially for complex, distributed systems.

Example 3: Legacy System Integration

In another scenario, you might find yourself working for a company that has been in operation for decades and has a significant investment in legacy systems, perhaps written in COBOL or Fortran. While these languages might not be the first choice for new projects, understanding and integrating with these systems could be critical for the business. In such cases, choosing a modern language that facilitates interoperability, like Python, which can connect to legacy systems through various libraries and interfaces, might be the strategic choice. Python serves as a bridge between the old and the new, allowing the company to leverage its existing investments while gradually modernizing its infrastructure.

In each of these examples, the decision on which programming language to use is influenced by a mix of factors: the project’s specific requirements, the team’s expertise, the ecosystem’s support for the task at hand, and the strategic goals of the business. It’s a balancing act, requiring you to weigh the immediate needs against long-term considerations like maintainability, scalability, and the ability to adapt to changing market demands.

Now you understand that technical capabilities are paramount. So you need to ask yourself, what’s important for this project? Whether it’s the speed of execution, integrated A.I. algorithms, compiled vs dynamic, needs to run on different OS or just Linux, memory management is crucial or can be ignore? The language must serve the project’s core needs.

Now let’s talk about the personal preference when choosing the language. If you’re a lead architect, you can probably choose the language that your team is the most capable with. In the end it’s you who’s going to be building the project, your team who will be maintaining the project, and your team will be responsible for future extensibility. So personal preference has a huge impact on your choice, though some developers will say that they’re unbiased, but in my opinion, everyone is biased.

Avoid the trap of the “golden hammer” syndrome, where familiarity with one language leads you to use it for every problem. This approach might work in the short term, but it limits your growth and the solutions you can offer. There’s so many different languages, and a language is just a tool in your toolbox. Embrace the diversity of languages and technologies, each with its strengths and ideal use cases. I’m not saying you should master all of them, but definitely have a few of them in your belt. Like a master woodworker who knows exactly which tool to use for each task, your goal is to develop a broad understanding of when and why to use each language.

In closing, remember that the journey of a software developer is one of continuous learning. The languages you choose to adapt will change over time, your personal preferences will change, some languages will get deprecated and die out.

Don’t worry for now if you don’t know which language to choose โ€” choose the one that’s in the top 5 and you wont miss, with time you will learn the weaknesses of each of the language you work with and it will make it easier to decide for your next project.

Cheers,
Vadim




Hot! The last couple of years I've been writing about CTO / Tech lead job. I've compiled all my knowledge into a printable PDF. I called it "196 Pages of No Bullshit Guide for CTOs". So if you're interested, take a look.

New! If you're a software engineer looking for a job, I started a Roast my Resume service, where I record a personalized video of me "roasting" your CV, which basically means taking a hard look at your resume as a CTO and commenting on all the good and the bad parts.