The Business of Programming LanguagesFirst published on: 15 June 2015
Picking the right programming language for a project can be an important business decision, and making the wrong choice is usually expensive. After reading this, you should have enough background to have an informed conversation with your development team.
Programming languages allow humans to tell computers how and what to do. Everything your computer does (browsing the web, responding to email, playing games) was programmed into the computer using a programming language. Unlike human languages with their many ambiguities, programming languages are excruciatingly precise.
Why are there so many, and when does it make sense to use one instead of another? This article provides a non-technical answer to both of these questions.
Before answering our two questions, we need to discuss something important that most non-programmers won’t get:
Programmers typically have strong emotional biases for or against certain languages.
This can make it difficult to fully trust the advice of a freelancer or a small software development team.
It is not uncommon for new developers to learn a single language and continue programming in it for many years without ever learning a second. This developer may argue vehemently to use the language they know, even if it is not the best fit for your project. The same can be true for small teams. If a technical team isn’t willing to consider other languages, it is usually a warning sign. There are often multiple languages that can be a good fit for a particular problem.
Different biases exist at the other end of the spectrum. Talented developers are often drawn towards and even zealously promote new exciting languages; they will argue that a new language is superior to older languages for specific technical reasons. Even if their technical assessment is correct, new languages are often a poor choice from a business perspective for the following reasons:
- they evolve more frequently, requiring your code to be updated along with the language
- there are fewer fluent developers in the language to hire
- there is less reusable code written in the language
- it is more likely that the language will die out; if this happens, you will either have to maintain the language yourself (very expensive) or re-write your project
- they have less documentation and fewer tutorials online.
You should always be aware of the popularity of the languages you are considering (check out this useful site).
Finally, there is a cultural vibe to most programming languages, and some programmers simply don’t like a particular culture. For example, developers who like the languages Ruby and Python typically view the opposing language as inferior, to a somewhat irrational degree.
What Makes Programming Languages Different
So, back to the first question: why are there so many programming languages?
In the same way that no person can be an expert at everything, no language can be well-suited for every task.
This is why there are so many languages in popular use. For example, there are languages that specialize in
- scripting 2D video games
- grabbing data from a relational database
- simulating biological systems
- identifying patterns in a bunch of text
- solving linear algebra equations.
However, most mainstream programming languages specialize in a more general sense:
- running quickly
- being easy for beginners to pick up
- running on many operating systems
- taking advantage of super computers or massive parallelism
- running web applications
- being “embedded into” other programs
- protecting against programming errors
- helping programmers work quickly.
To help exemplify how two programming languages can be better or worse at a particular task, the following is an example of the same simple program written in two different languages. You don’t need to understand the details of either to see how one is superior.
This simple program runs three other programs,
c, and stores their output in a log file. It is written in the Bash programming language, which is very terse. Here is the same program written in Python:
The program written in Bash is much shorter and is, in nearly all respects, better for this application. This is because Bash was designed to be good at running other programs (and not much else). On the other hand, the Python program is verbose, but Python is a more general-purpose language. For a large project, you would likely chose Python over Bash because writing most types of code in Bash would difficult, slow, and hard to understand. All of the “shortcuts” that made Bash well suited for managing processes are simply confusing in another context.
This is an example of a trade off between specificity of purpose, and general utility. Trade offs like this make it impossible for any language to be ideally suited for all tasks.
High and Low
Another important trade off involves how quickly the program runs, and is very relevant from a business perspective.
Programming languages that let you tell the computer how and what to do in a very detailed way are called “low-level”. Programs written in low-level languages can be very fast, at the cost of being more difficult, time consuming, and thus expensive to actually write. Programming languages that hide the low-level details of the computer are called “high-level”. High-level languages let the programmer worry about the big picture instead of details about how the computer runs.
There is a trade off between being “fast to develop” and “fast to run”.
Let’s illustrate this trade off with two examples.
Imagine you want to simulate traffic patterns in Austin, Texas so you can decide if they need to build another highway. In a high-level language, it would take a developer two months to write the simulation, and each simulation would run for a full week. In a low level language, it would take six months to write, but each run would take an hour. If you only need the simulation a few times, it would be cheaper and quicker to use a high-level language. If you will need to run simulations for a few years, it may be worth using a low-level language. There are other benefits to writing fast programs: if you can run the simulation in a hour, you can probably compare more scenarios and place the highway in a better location.
Now imagine you want to write a dating app for opera singers. You hire some developers to write a program that stores everyone’s hair color preferences in a database and gives the app access to this data. It may take a developer a month to write this program in a high-level language, but it costs $100/month of processing time for every 5,000 opera singers. In a low level language, it may take a developer four months to write it, but it only costs $5/month per 5,000 opera singers. Well, there aren’t that many opera singers, so the high-level language is clearly the way to go. But imagine you have many thousands of users. Processing time starts translating into a lot of money.
Finally, there are other benefits to writing fast programs. For example, Google takes into account page load speed when ranking your site in its search engine.
For most startups and business applications, you should first write the program in a high-level language. If its necessary, re-write the program in a low-level language to speed it up. Not only do you hedge the risk that you will spend a lot of time and money on an app nobody likes, but also your developers will learn from the first version, and will be able to improve the design on the second pass.
There are many tangential factors that should influence your choice of a programming language.
If you are expecting your software to run for more than 5-10 years, you may want to verify that there are big companies that have written large programs in the language you are considering. This reduces the risk that the language will die out and become obsolete while you are still using and maintaining your program.
If your team already knows a language and you have properly considered other choices, you should use the language they know. This is especially true for languages that are similar to each other (e.g. Python vs Ruby vs PHP or Java vs C#).
If your project involves a lot of specialized tasks, you may want to see which programming languages have good libraries for those tasks. For example, imagine you are writing a program to sift through corporate email archives for fraud; you may want to see which languages have libraries for reading email archives and performing language analysis. If one language has both, it may be worth using just for the libraries!
If your program must run on a particular platform (e.g. an iOS app), obviously you need a language that will run on that platform.
Hopefully this article has provided some useful insight. If you have questions, comments, or would like to consult us on your project, please email us at firstname.lastname@example.org.
If you want to learn more about programming languages, code, and software, you should read this other great (but long) article, What is Code?
Was this article interesting?
We publish technical articles and coding case studies about topics we run into in the field. Follow us on Twitter or subscribe to our email list:
Back to All Articles