This is probably the most often asked question by beginners and I decided to finally address it in this article. Right away, you should know that there is no single answer to this question. It all depends on the field you want to get in, market conditions and your personal preference. Professional software developer almost always have experience with multiple languages, but as a beginner you need something to start with and learn fundamental concepts quickly. I will start with the list of software development careers and most popular languages used in them.
Mobile development
With the expansion of smartphones this niche became one of the most popular choices for beginners and it's quite easy to get started with. You don't even need to have physical device, as you can run your applications in emulators and virtual machine (but having mobile device is highly recommended and mandatory for professional career in mobile development). When I say mobile I mean developing apps for both, mobile phones and tablets.
For Android development, you should start with Java. It's possible to use Kotlin and C++, but Kotlin is still not much used and there are much less tutorials for it since it's younger (but after you become comfortable with Java you can try and see if you like it; it's quite similar to Java, although less verbose) and C++ is used in very specific situations.
For iOS development, you should start with Swift. It's relatively young language designed by Apple to replace it's decades older language Objective-C and it's compatible with it. You can use Swift for Mac development too.
Today, it's possible to use different frameworks and other languages (such as C#) for developing Android and iOS applications, but you won't have official support and finding tutorials will be much harder in that case. There are also much more jobs for mobile developers using official languages of platforms.
Summary: Java for Android development, Swift for iOS development. C# for cross-platform development.
Web development
Web is the most popular platform with billions of users all over the world. Whether you choose front-end (on side of the client) or server-side (on side of the server) development, you won't make a mistake.
Front-end development is development of presentational part of the web site / application. Most employers demand from front-end developers to be comfortable with fundamental web technologies, HTML (markup language) and CSS (stylesheet language) and more advanced knowledge of JavaScript. JavaScript ecosystem exploded in last few years and there are many other languages which translate to JavaScript like TypeScript and Dart but beside the fact they're very similar they basically do the same thing - they make writing JavaScript code easier and add some features which are not readily available. With the expansion of Node.js it's possible to use JavaScript on server-side too.
Back-end development is development of server-side part of the web site / application, which couldn't be seen by user. It deals with getting data from user, manipulation of it, storing it in the database, searching for it and returning it back for the user (basically you're working with data on the basic level, but on advanced level you have to do some more complex processing too). There are many languages available for back-development, either for specifically designed for that purpose (like PHP) or general purpose ones (like Java, Python, Ruby, C# etc). PHP is the most popular one because it's easy to get started with, hosting is cheap and there are many popular content management systems (WordPress, Drupal, Joomla) and frameworks for it (Symfony, Laravel, Yii, Zend etc). Other languages have their popular web development frameworks too and you should check frameworks of the language you choose to see which one is the most suitable for your needs.
Full-stack development is the term for developing on both sides of the application at the same time and, in my opinion, it's the best way to learn how web applications are working.
Summary: HTML, CSS and JavaScript for front-end development. PHP, Python, Ruby, C#, JavaScript or Java for back-end development (there are many other languages used for back-end development, but they're much less used and I won't bother you with them at this moment).
Game development
Along with military software, video games (especially AAA titles) are one of the most complex piece of software to develop. Developing video games is long and tedious process which involves many different parts, but here I'll focus only on the aspect of programming.
The most popular language used in game development engines is C++. It's because C++ is high level which allows programmers to write better organized code with various features available out-of-the-box, but at the same time it's possible to write highly-performant code in it, in comparison to languages like Python or Ruby where programmer is very limited in that sense.
It doesn't mean, however, that developing games in Python or Ruby is not possible. Almost all popular programming languages have libraries for game development. There are also many tools for rapid game development like Construct and GM:Studio which are using their own languages, but they're mostly used by hobbyists.
Unity is very popular solution for both, hobbyists and professional game developers which uses C# and JavaScript languages for scripting. There is Community and Pro (paid) edition, so you won't have to cash out lot of money to get your feet wet.
Summary: C++ (or C# if you use Unity). Almost any other popular language which has game development libraries.
System development
System development is development of system software. Obviously. But what is system software? System software provides platform for application software or the software which is used by user directly (text processing software, music players, web browsers, file explorers etc). Examples are operating systems, compilers, game engines, industrial automation, SaaS (software as a service) and many more.
This type of software demands high hardware awareness of programmer, as it's built to be highly-performant and secure. It's much more important to actually understand computer architecture than which language you're going to choose, so this type of development is not recommended for people who never programmed before.
C and C++ are most popular system programming languages. There are also some new kids in the block like Rust and Go which are getting more traction, but since most of the system software is written in C and C++, they are going to be used for a looong time. Although it's much less used, Assembly is required in some parts where very precise, fine modifications are needed. There are different Assembly languages for every architecture, and as it is the case, you are required to understand how computer works to write even simple programs in it. It was used even for application development back in the days before higher-level languages, but since compilers (software which translates code to machine instructions) have become much more advanced, they're less and less used.
Summary: C or C++. Assembly for finest work. Rust for thread safety and compile-time warning checks, Go for network programming.
There is much more to say about every field, but I would have to write much longer post and I think it's unnecessary since post provides enough information for beginner to choose it's first language in my opinion. People often recommend languages with easier syntax like Python and Ruby and I generally agree with that if person doesn't know specifically what it wants to do but rather want to get his / her feet wet. If you have any other questions or suggestions I forgot to add here, be free to give your comment.
I hope you enjoyed this article. If you did, upvote and follow me for more content like this, and comment if you have questions or something to add. Cheers! 🍻
@originalworks
If you are just starting to programm it can be really useful to get instant feedback on what you are doing. I would recommend an interpreted language like python to start with - at least for the basic concepts like loops, if-statements, classes, functions etc..
As you get more exprerienced you will find out for yourself what language suits your case best.
I am using Python professionally but this just accidentally works for me.
Whatever you do, dont become a language nazi. There is no "best programming language" and there probably never will be. It will always depend on what you are trying to do. (basically don't use a hammer to scew in a screw just because you are already familiar with the hammer but not the screwdriver)