Michael Safyan

Which language?

Which programming language should I learn?

Short answer

There are lots of options and no right answer; check out the summary at the bottom.

Long answer

It depends on what you are trying to do. Most applications these days involve a number of different components, with code written in a variety of languages and running in a number of different locations. Different programming languages are better suited to different tasks and to different locations of execution. For example, a best-in-class app will typically have code that runs in a datacenter somewhere (i.e. in the "cloud"), code that runs on the user's favorite mobile OS, and code that runs in the user's browser. This is illustrated by the diagram below, where code running on Android, on iOS, and in Chrome communicate with code that is running on the Google Cloud Platform.

The code in the datacenter typically provides logic that is shared between devices/OSes, saves user data so that the user can retrieve and modify their data regardless of which computer they use, performs complex computations or precomputations that would take too long on the user's device, and sends push notifications to users when the application on the device needs to display new information. The code running on the mobile device provides the user interface in a way that fits into the platform and takes advantage of device- or OS-specific capabilities. Code running in the user's browser provides the user interface on the web for desktop, for users who have not installed the mobile apps, or for low-end devices or mobile OSes for which an OS-specific mobile app is unavailable.

All of these different components are extremely important to creating a high-quality application, so you should simply take your pick of the component or components that you want to focus on, first. If you want to write the code that runs on Android, then the Java programming language is your best bet (you can also program Android using C++ with the NDK, but Java is the preferred and most well-supported option for Android). If you want to write the code that runs on iOS, then Objective-C or Swift are your best bets. If you want to write the code that runs in the data center, you have a lot of different options, though the cloud provider that you use as well as the frameworks you have in mind may help narrow down those options (for example, while you can use any programming language on Compute Engine, there is a limited list of supported languages that can be used on App Engine). Personally, for server-side code, my recommendation would be Python for small-medium projects where time-to-market is the priority over stability and Java for medium-large projects where stability is more important than speed of development; however, it would be remiss of me to fail to note that JavaScript (with Node) is a very popular option these days (though I personally consider it to be over-hyped and not a particularly good idea) and that there are many, many more options for server-side, including C++, Go, Ruby, PHP, and pretty much any language you can think of. For code that runs in the browser, you ultimately need HTML, CSS, and JavaScript, but there are a large number of other languages that can be used which can be converted to these; for example, it is possible to write browser code entirely in Java and have it converted to HTML, CSS, and JavaScript via GWT. Similarly, Dart, Typescript, and Coffeescript all provide alternatives to JavaScript that can be used to produce JavaScript; Sass provides an alternative to CSS; Haml provides an alternative to HTML.


To summarize everything above and also insert my personal opinion so as to help you choose:

  • Android: choose Java (or C++ if necessary)
  • iOS: choose Objective-C (or Swift)
  • Server-side: choose Python for rapid iteration, Java for large/stable projects
  • Browser: use HTML, CSS (or Sass), and JavaScript (or Dart)

My statements are my own and do not necessarily reflect the opinions of Google Inc.