What's the best programming language? The question we all have once asked. I remember going through endless Stackoverflow discussions and Quora answers, only to find the last line stating the obvious. Use the language which suits you well.
There are more than a thousand programming languages! But how do we decide which language "suits" us? Is it a match made in heaven? Does god have a secret plan for us? After all, it plays a major role in one's career. Even if it's for your next project, an improper choice can lead to a lot of struggling in the future.
And guess what? It isn't that difficult. It all boils down to 4 simple questions you need to ask yourself to choose your next programming language.
1. Deciding your target platform
What do you want to develop? Android or IOS? Desktop or Web? Or you're the IoT guy wanting to go embedded! The first step is to decide the target platform. This will filter the thousands of programming languages we have down to a few.
You need not restrict yourself to just that though. You may also dig down to more technical aspects such as a particular runtime environment like JVM. Or sometimes move away from it (like in our case). Sometimes having a static binary as the final result is important while sometimes you want to write once and run everywhere.
It is important to zero on what you want to build with the programming language.
2. Learning Curve
Do you want to start hacking and coding the very next day or can you wait years before you have mastered the language's true potential? Learning curve is the time required before you can actually start using a programming language. Steeper the learning curve, the more time will it take for you to learn it.
Each use case is unique. If the project is urgent, it might not be feasible to invest time in learning a new language. While in a growing and expanding company, you would want to use something which is easy to learn.
Sometimes the benefits of a programming language outweighs the time required to master it. You need to figure out the time you have to spare to learn the language.
3. The Community
This is perhaps, one of the most neglected aspects of choosing a programming language. The community is what the future of a language ultimately rests on. Ever heard of Nim or Myrddin? These are potentially strong programming languages which never caught on.
The community builds and maintains all the libraries and drivers which we use on a daily basis. To make things simpler to understand, no community means no libraries. And trust me, you don't want to reinvent the wheel for almost everything.
Libraries aren't the only sign of a vibrant community. Remember what you did yesterday when you got stuck somewhere in the middle of the code? You used Google! And the first website you visited was Stackoverflow!!! Okay if it wasn't Stackoverflow, it was definitely Quora. The point is that these are community driven platforms.
If you don't want to be the first one trying to figure out how to do something you are stuck at, stick to a programming language with a strong community. The same rule holds true for any other technology.
I remember spending hours every week trying to hunt down the fastest programming language. Going through blogs and forums. Analysing every benchmark there was. Did everything to make the most performant applications possible. But as a wise coder has once said, "If speed is the only thing you're looking for, stick to assembly" (FYI assembly is still used in many scenarios till date).
You don't need to go all the way rating every programming language on a scale with the exact benchmark numbers. All you need to do is decide how important is performance for your particular use case.
You may also group or pair languages which exhibit similar performance characteristics. Always remember that performance isn't the only metric you have available.
Also performance isn't restricted to the speed of execution of a programming language. You may also consider the memory footprints and other overheads. For example, many languages use a "Stop the World" approach to garbage collection. This means your program would freeze while the GC runs for large heap sizes making the application unresponsive. In some cases, this might not be feasible.
Also, the performance of a programming language doesn't necessarily map to the performance of an application. For example, even if you use rust (a super fast language) but are using an unoptimised database on the backend, your overall performance will still be really low.
You do not need to stress about all these points which I've mentioned. But it's always good to know your language in and out if you are planning to stick with it.
5. Bonus - Ease of Concurrency
Being a backend developer, I could not resist adding this point. Concurrency is super important if you're trying to build a system to handle thousands of clients. Or maybe millions. Concurrency is the key to efficiency. Simply handling a new client on a new OS thread isn't really a good idea. It becomes extremely important in such cases to see how easy it is to do concurrent programming in your language.
There are multiple models to choose from. Green threads, Futures, Thread pools and my personal favorite Actor based concurrency are some of the popular ones. Some programming languages were specifically made with concurrency in mind. For example Golang uses "go-routines" and channels.. Rust has a unique approach of "Ownership", to prevent data races all together.
Applications are becoming smarter and more connected everyday. User experience is at an all time high. We want answers within a fraction of a second. All this requires you to plan your system architecture well. And the first step in that direction, is choosing a programming language which helps you simplify it.
I know how easy it is to get overwhelmed by all the information we can find on the internet. It's alright. You don't need to be a PhD scholar. Some basic exploration is enough to get you started. And that's what is important. To start. So stop googling further, and start coding. Cause that's what we do.
Did this article help you? How did you choose your language? Share your experiences below.