What programming language should I learn on my Mac? Best programming languages for coders compared, including Swift, Python, Java, C and Perl.

Coding has never been more popular, and learning to program in Mac OS X is a great skill to get. But which programming language is best to learn? There are dozens (if not hundreds) of programming languages around, and each was developed for a purpose.

So choosing a programming language to start out with can be a real challenge. Should you go with Apple's own Swift language, or another popular rival like Python or Java? C-based languages, like C, C++, Objective-C or C#, are used to write many programs. So is C a better choice to learn?

There are far more options to consider: PHP is used widely on the web, and powers big sites like Facebook. And languages like R, MATLAB and Mathematica are used by data scientists

Or should you throw it all in the wind and learn Assembly Language, the language that's closest to the machine hardware (hint: "no")

What's the best programming language to learn on my Mac?

Java is the best programming language to learn in OS X

Picking the best language is a tricky business. Best is a subjective term, and opinion varies wildly on which is the best programming language.

The Stack Exchange Developer Survey is a good place to find what developers think. The top 12 Most Popular Technologies are:

  1. JavaScript
  2. SQL (or SQL Server)
  3. Java
  4. C#
  5. PHP
  6. Python
  7. C++
  8. C
  9. js
  10. AngularJS
  11. Ruby
  12. Objective-C

That list gives you a pretty good overview of which technologies to learn. Sharp-eyed readers will notice a distinct lack of Apple's new Swift language on that list. Don't assume that Developers don't like Swift (it ranks as the second "most loved" language on Stack Exchange, after Rust).

If developing iOS apps is your game, then Swift is the language you'll need to learn. But it seems that there's more activity in other languages (although Swift is trending highly on Stack Exchange and next year might tell a very different story).

Is JavaScript the best language to learn?

It's important not to confuse JavaScript with Java. JavaScript is a scripting language used to create interactive web pages while Java is a programming language created by Oracle. Java is mainly used to program Android devices.

JavaScript is more limited than Java, or other programming languages. But it's a good place to start if you have zero programming experience. You can learn JavaScript alongside HTML and CSS to create vibrant websites. You can build something pretty stunning with just a little JavaScript, and quickly see results online. And it'll help you move onto Java.

Should I learn Java, Python or Swift on my Mac?

Learn Python in Mac OS X

Controversially, we're going to suggest that you don't start with Apple's Swift language. Even though it's incredible, and we're a big Apple site, we think it's a bad choice for beginners.

There are a wider range of training resources for Java and Python than Swift, so you'll find it easier to learn one of those two languages. Which one you pick is a personal choice, and we suggest you base it by answering one of these two questions.

  • I want to build stuff! Then pick Java. It's the most popular programming language and used by countless companies to build apps. Google used Java to build Google Docs, as well as the Android operating system.
  • I want to know how stuff works! Then pick Python. It's used by computer scientists to create algorithms, and used by MIT to explain concepts like Machine Learning and Artificial Intelligence. It's a very easy language to learn, and incredibly powerful.

If you're serious about programming, you'll end up learning both Java and Python at some point. They're universally used to train programmers and build apps.

See also:

Should I learn C on my Mac?

C is an incredibly popular language that has been used since the 1970's to teach computer programming. Importantly, it's used by Harvard in its CS50 course, used to teach all of its students the basics of computer science.

So it seems a bit churlish of us to dismiss it out of hand. Even so, we don't think you should start out with C. It's more complex than other languages, and you'll quickly get bogged down with concepts like memory managements and pointers. It's all too easy to end up frustrated and decide that programming isn't for you.

So unless you are on a course like CS50 and being hand-held through your programming experience, we suggest you stay away from C and all other C-based languages. You can learn it later.

What about learning SQL, PHP, and other technologies?

A lot of the other technologies listed, such as SQL, PHP and Ruby are all worth learning at some point. But they aren't the point to start out using. SQL is a database language that's commonly used to store, and retrieve items. It's often used in web servers, but also in apps (iOS and Android apps make use of SQL databases). PHP is a scripting language used online, and Ruby is used to create interactive websites. They're all worth learning at some point, but they aren't the place to start.

If you are a total beginner, then learn HTML, CSS, and JavaScript. Otherwise, the best programming language to learn on your Mac is Java. If you are interested in the mechanics of programming, learn Python.

Once you've got all that working, it'll be time to move on to other languages like Swift and C.

See also: