What if programming languages were stocks? And you had to make a portfolio to fetch good returns in 2022?
You probably have seen various surveys and analyses listing the most popular programming languages. Those cover the universe of programming languages, like the S&P 500 does for the stock market. What would be the best portfolio for you to be successful and outperform the rest?
Of course, it depends on the risk profile, or whether your focus on a specific sector, e.g., web, mobile, enterprise, machine learning, and edge/embedded.
But let's say you want to pick 10 stocks for a diversified portfolio and a medium-risk appetite. Stocks are of 3 types:
- Large Cap: Big corporations with stable businesses, like Fortune 500 companies. The upside is stable but not manifold, and the downside is limited.
- Mid Cap: Mid-size companies with a high chance of becoming large-cap in the future. These offer much higher returns, but can also go down significantly.
- Small Cap: Upcoming companies. Currently very small, but showing high potential. These might turn out multi-baggers but are very risky too.
If you invest only in large caps, your returns will be subdued. If you invest only in small caps, you might hit a jackpot, but can also go bust and lose your shirt. A diversified portfolio allocates money to each asset class. That keeps returns stable, and also has a fair chance at higher returns.
In this article, I present an opinionated portfolio of 10 general-purpose programming languages, with 50% large-caps, 30% mid-caps, and 20% small-caps. These languages will suffice most of the work done by most teams and organizations.
Large Cap programming languages are dominant players in at least one domain or ecosystem.
Python is an interpreted, dynamically typed, and garbage-collected programming language. It is one of the dominant players in web development, and it is the de-facto language for machine learning and data science.
Flask, FastAPI, and Django are popular frameworks for developing microservices.
NumPy, SciPy, Pandas, Scikit-Learn, TensorFlow, and PyTorch are among the most popular libraries for data processing and machine learning. Jupyter Notebook is a popular, almost de-facto, IDE for data scientists.
It is one of the easiest languages to learn and start with. It does have performance issues (including the infamous Global Interpreter Lock). But that has not stopped it from powering highly scalable services at tech giants.
Node.js is a popular server runtime. Express, Sails, Hapi, Meteor, Loopback, Fastify, Koa are the most popular web service frameworks.
React, Angular, Vue, Ember, Inferno, Svelte, Preact are popular front-end frameworks.
Java is an object-oriented, statically-typed, garbage-collected programming language that is interpreted on Java Virtual Machine (JVM) with a Just-In-Time (JIT) compilation.
Java is performant and battle-tested, that’s why it dominates the enterprise software market. It is also a dominant language in Android app development.
The Java/Jakarta EE is the classic platform for developing monolith services. There are a number of microservice frameworks: Spring Boot, Vert.X, Helidon, Lagom, AxonIQ, Micronaut, Dropwizard, Quarkus.
Java is also a prominent language in data processing applications. Most Apache data processing frameworks such as Spark and Flink are based on JVM.
C# is a statically-typed, garbage-collected programming language for Windows .NET runtime. Active Server Pages (ASP.NET) is the web-development framework for .NET platform.
There is a large installation base of Microsoft Windows Servers, which now is migrating to Azure cloud.
Most Microsoft applications and .NET services are written in C#. So Microsoft ecosystem will continue to be dominated by C# for quite some time to come.
Swift is a general-purpose, statically-typed, compiled language. It is a replacement for Objective-C
Apple iOS is one of the two dominant mobile platforms, and Apple App Store is a lucrative marketplace for iPhone and iPad apps. Swift is the de-facto programming language for creating iOS apps.
Mid Cap programming languages have grown to have significant usage, and are likely to become a dominant player at least in one domain or ecosystem.
Kotlin is a cross-platform, statically-typed programming language with type inference. It runs on JVM and is fully interoperable with Java. Google has made it the preferred language for Android.
On server-side, it can run on any Java microservices framework, as well as Ktor or http4k. Kotlinx.html is a DSL to build DOM, and Kotless is a framework for serverless deployment. There are a number of growing Kotlin data science libraries as well.
Go is a statically-typed, compiled programming language from Google. Its syntax is similar to C but has memory safety, garbage collection, and structural typing.
Go is suitable for writing scalable servers due to its highly performant concurrency and low resource consumption. There are several frameworks for writing REST and gRPC services: FastHTTP, Fiber, Chi, Gearbox, Go kit, Gorilla, Gin, Echo.
Go’s USP is its performance, so it has the potential to become dominant in writing server-side code.
Scala is a statically-typed object-oriented and functional programming language. Scala code can be compiled to Java bytecode and run on JVM. It offers advantages of the JVM ecosystem without the verboseness of Java.
Like Kotlin, it is interoperable with Java. Apart from Java frameworks, Scala services can be developed with frameworks such as Akka HTTP, Play, Chaos, and Scalatra.
Scala is also quite popular in writing big data processing applications. It will be interesting to watch and compare the growth of Kotlin and Scala.
Small Cap programming languages are with a small user base but have shown good traction. If growth continues then these may turn into Mid Cap or even Large Cap. These are bets with potentially high potential payoffs.
Rust is a statically-typed programming language designed for performance and safety. It has a strong type system and ownership model that guarantees memory-safety (without garbage collection) and thread-safety at compile-time.
The obvious use of Rust is in developing back-end services, but it can also be used to develop front-ends with Web Assembly. Hyper, Rocket, Actix, Warp are among the most popular rust web frameworks.
Rust frameworks are among the fastest in the Web Framework Benchmark is not surprising considering Rust’s compile-time memory and thread safety guarantees. With front-end WASM frameworks, Rust can become a formidable full-stack alternative.
Dart is a statically-typed, garbage-collected programming language designed for client developments for web and mobile apps.
There are several surveys and analyses for the most popular programming languages (e.g. Stack Overflow, GitHub Octoverse, GitHub GitHut, TIOBE, PYPL Index, and IEEE Spectrum).
In this article, I presented my portfolio of 10 general-purpose programming languages and the reasons for their selection. Here are some languages that were in close consideration due to their relevance to specific domains:
- C/C++: embedded systems and edge devices, gaming;
- R and Julia: machine learning;
- SQL: data engineering;
- HTML/CSS: web development;
- Shell: scripting, automation.
Here is a summary along with the time, memory, and energy efficiency rating of the programming languages in the portfolio:
Top 10 Programming Languages in 2022