Ask HN: What programming language should I learn next?
Recently I've been itching to learn a new language.
I work mostly in Python currently. I've also worked extensively with Javascript (browser/nodejs). I've worked with C# and Java and Dart. Dabbled in C and C++. Played with Lua.
What should I learn next? My goal is to expand my skillset and maybe find the holy grail of programming languages (probably not). I'm a generalist and a freelancer.
My shortlist:
- Go - Rust - Elixir - Swift - Kotlin
Or maybe something I haven't listed?
48 comments
[ 226 ms ] story [ 2288 ms ] threadAfter that, do you want something practical or something educational?
Kotlin is a solid balance of both, and having JVM ecosystem interop makes it extremely useful for a generalist.
If you want to try something pretty difficult, but familiar, try a super-strict language like Ada.
If you want to try something completely different, I would suggest a functional language.
Elixir is already on you shortlist. I would also suggest taking a look at OCaml, Erlang, F#, Clojure, etc... However, I would not suggest Haskell if you're just starting out in functional.
Go: It is really good for web apis and making cli apps
Rust: Suited for system level very high performance computation
Swift: Mostly for apple ecosystem
Kotlin: It might be most general purpose language, can be used for mobile apps, Web backend, native development
For a great low level language with a pleasant syntax and a good community: Rust
Skating to where the puck is going to be: Elixir.
In Rust, my understanding is that it's a bit more like C or C++ in that multithreading requires an explicit opt-in and you can be a bit more thoughtful about what workloads are running on what thread (i.e. lock gui to one thread, do background processing elsewhere). This also looks pretty neat: https://azul.rs/ Not sure about the state of it, how useful it'll be, etc, but it already looks more complete than most GUI libraries for Go.
Some say choose OCaml over F# because of functors. Some say choose F# over OCaml for those unique features in F# that OCaml doesn't have.
If there is an optimized trade off for choosing a language, what would you recommend me to settle for?
- Ruby for most things (most generalist language I know)
- JS for whatever can't be done in Ruby
- Other languages when anything really can't be done (or a magnitude harder) in JS or Ruby
I think just trying out to make some simple thing (e.g. an Hacker News scrapper) in different languages will tell you much more than any person's opinions.
https://learnxinyminutes.com helps grabs the basics of a language quickly (especially as you are familiar with other languages).
I would say try Elixir since trying to go and think only functional for a while can be refreshing and useful also when you come back to the languages you already work with.
Go is great if you do a lot of scripting or web dev. But wouldn't be so good if you're making chatbots.
A chatbot or real-time message passing would be great to use Elixir for.
Rust is great for WebAssembly or desktop programming as a replacement for C/C++.
Swift and Kotlin are the obvious choices for mobile development. Are your customers asking for mobile apps? Do you want to build mobile apps? These would be obvious choices.
Chase the problem you're trying to solve and use the right tool for the right job rather than trying to learn a language just for the sake of learning it. I find trying to learn a language I won't use to be something that quickly drops off my radar.
Along with power, I like the view on utility.
As you write, thinking about your immediate problem and future problems (i.e., if you could anticipate) to solve, are also good points to consider when deciding about that next language to study.
Without that motivation, a lot of us struggle with going beyond various ineffective learning strategies (reading the docs, doing a hello world, getting sucked into the particular language's bike sheds).
Q: What language should I use to solve problem P? A: Don't waste time on premature optimization, use whatever you are already familiar with and get your prototype done.
It has some drawbacks like very slow compile time but it make your code sooo more robust!
On the other hand Go's pointer system and lack of immutable semantics make it really easy to introduce bugs when LOC >= 15k.
Rust support for arm, and wasm (without runtime, unlime Go) make me feel it have a great future and personally I'll never look back.
Go's lack of algebraic data type is a real panacea and make programming experience so painful.
Be prepared to have a bigger CI/CD (due to resource intensive compilation) but then your infra will requires far less resources! And you'll finally be able to sleep at night without fearing to have your infra burning.
Please note my use cases are HTTP APIs, cli programs and banckend dev like infra.
I am not suggesting that you learn Scheme. Scheme is an esoteric language, well down the list of commonly used programming languages.
What I am suggesting is that working through the book (using Scheme or Python) will give you a deep dive into many of the fundamentals of computer science. If you get all the way through the book (many more start it than finish it) you will have a powerful conceptual toolkit that will help you, no matter what programming language you're using.
Personally, Scala is my favorite language.
- Declarative + functional programming - Highly productive (great frameworks for embedded + web, developer ergonomics, etc) - Great exposure to Actor Model concurrency - Great generic performance (no stop the world gc, strong multicore use via Erlang scheduler + processes, and lots of optimizations based on vm immutability) - Lots and lots of exposure to systems stuff + strong devops tools (built for distribution*, Erlang runtime tools, observer, great logging and telemetry libraries, etc) - Lots of built in services/tools (can use ETS instead of redis for things like auth-checking throughput)
Implicit copying, unsafe access in multithreaded scenarios, deficiencies in type systems, and more - all become obvious and inescapable observations when using many other languages.
I'd imagine this effect is lessened if you came from C/C++ and watched the birth of Java, JavaScript, C#, etc., however as someone who started programming more recently, Rust has been the lightbulb moment for me for how languages work under the hood.
I don't think it's a language that will solve everything, but it certainly seems to excel in its specialty, which is concurrency and robustness. I'm looking forward to learning Phoenix, which will allow me to develop web applications in Elixir.
If anyone is interested in Elixir, I've been regularly writing about Elixir as I've been learning it at https://inquisitivedeveloper.com/. The idea is that you can learn Elixir along with me as I learn it and write about it. I make some comparisons to Javascript and C#, as those are the languages I use most often at work.
I was expecting to encounter a lot of very unfamiliar concepts, but to my surprise, I was already familiar with most of them. I guess my experience with the functional aspects of C# and libraries like Bacon.js and Rambda in Javascript really prepared me well for moving to a functional language.
If you want something challenging and practical, I recommend Rust. It'll be much faster and easier to parallelize than the languages you've worked with, which may open up new possibilities for you.
And then create your own language :)
For prototyping, I recommend Python's lark-parser library, which will generate a parser from your grammar for you.
It’s a fun language to learn as it has a repl to interactively develop with and it has a fun online, free book to begin with called Clojure for the Brave and True.
The single biggest reason I recommend it, is purely because Code is Data. In other words, you can write code to write code very easily and it’s a super meta concept that is very accessible to beginners.
mainly because that pg god guy says it's good or something.
but i also happen to believe it.
even osama bin laden was right about some things.
You're missing all of the HDLs. (Verilog, VHDL, etc.)