News for hackers. Stuff that matters.

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 | 37 points | on HN )
Re:Ask HN: What programming language should I learn next? by elamje on Wednesday March 27, 2019 @11:35PM (#19508995)
I recommend Clojure. It will, along with other lisps and functional languages, completely change the way you think about coding. It has a vibrant community, the author is very active and gives great talks, it’s interoperable with Java, it’s a lisp, and it’s functional. You can also hit swap production code with ease.

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.

Re:Ask HN: What programming language should I learn next? by shmooth on Thursday March 28, 2019 @01:46AM (#19509591)
i second this.

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.

Re:Ask HN: What programming language should I learn next? by inetsee on Wednesday March 27, 2019 @05:36PM (#19506319)
I'm not going to recommend a programming language. What I am going to suggest is that you try working through the book "Structure and Interpretation of Computer Programs" (also referred to as SICP). The original, which is the one I am trying to get through, uses Scheme as the programming language for the examples. More recently, some courses working through the book use Python for the examples.

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.

Re:Ask HN: What programming language should I learn next? by acconrad on Wednesday March 27, 2019 @04:04PM (#19505400)
Can I suggest you find languages that solve problems you are facing?

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.

Re:Ask HN: What programming language should I learn next? by rambojazz on Thursday March 28, 2019 @02:13AM (#19509699)
Q: What programming language should I learn next? A: find languages that solve problems you are facing

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.

Re:Ask HN: What programming language should I learn next? by hhs on Wednesday March 27, 2019 @05:01PM (#19505984)
I also considered the 'Blub paradox' that Paul Graham talks about. I asked where the different programming languages fit on the "power continuum" - that is, its features, what's present and what's "missing", and how I should weigh each when thinking about that next language to learn.

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.

Re:Ask HN: What programming language should I learn next? by mercer on Wednesday March 27, 2019 @05:13PM (#19506090)
Plus going for something that you feel solves a problem, or at least scratches a personal itch, makes it so much easier to actually go and learn/tinker/build.

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).

Re:Ask HN: What programming language should I learn next? by erk__ on Wednesday March 27, 2019 @03:55PM (#19505287)
I would reccomend trying a ML language like SML, OCaml or F#, I have recently written some f# again after break and it is nice to come back to a simple language that is fun to write in.
Re:Ask HN: What programming language should I learn next? by laurentl on Wednesday March 27, 2019 @06:09PM (#19506655)
I’m somewhat in the same position as OP, except that I know I want to explore FP. I’ve more or less settled on Ocaml, although I might be sqwyed by F#’s integration with the .net ecosystem (will have to look at some F# code to see if it makes me want to dive in as much as Ocaml)
Re:Ask HN: What programming language should I learn next? by erk__ on Wednesday March 27, 2019 @06:52PM (#19507035)
F# and ocaml are very similar, adn if you learn one of them you pretty much learn both, there are some problems with ocaml, for example it has two std libararies, the normal one and core by Jane Streeet. It also has to competing async libraraies. But the main code is pretty similar there are of course some things that are in ocaml that is not in F# (for example functors) but there are also things the other way.
Re:Ask HN: What programming language should I learn next? by philonoist on Friday March 29, 2019 @01:31AM (#19519394)
Considering that my main aim is to learn as many functional concepts as possible and must settle among these three languages, which language should I choose?

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?

Re:Ask HN: What programming language should I learn next? by erk__ on Friday March 29, 2019 @05:11PM (#19525716)
It depends, if you want to have a language that is used and supported a lot you should chose OCaml or F#. SML is not used a lot anymore but there are still a few places using it. I personally think that F# feel more modern to write for example ocaml have differnt operators for integers compared to floats. But it is mostly an opinion. As I said there is not a big difference between the two languages. So you would with a very short notice be able to move from one language to another.
Re:Ask HN: What programming language should I learn next? by philonoist on Saturday March 30, 2019 @03:55AM (#19528373)
Considering my sole criteria to be learning functional paradigm as deeply as possible, as propounded earlier, which among F# and OCaml takes me to that extra mile in teaching Functional concepts?
Re:Ask HN: What programming language should I learn next? by erk__ on Sunday March 31, 2019 @04:06PM (#19538020)
If you only want to look at functional a more pure functional language like haskell may fit yyou better both ocaml and F# allows to do functions which are not truly pure it even have mutable variables which are not normally a thing. So if it to learn purely functional haskell or SML may be better.
Re:Ask HN: What programming language should I learn next? by Maultasche on Wednesday March 27, 2019 @06:50PM (#19507009)
I recently decided to learn Elixir because I had heard good things about it from happy Elixir developers. It was the first functional language I learned and I found its concurrency model to be particularly interesting.

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.

Re:Ask HN: What programming language should I learn next? by drcongo on Thursday March 28, 2019 @08:45AM (#19511605)
This is excellent, thank you. I'll be learning along with you.
Re:Ask HN: What programming language should I learn next? by cweagans on Wednesday March 27, 2019 @03:54PM (#19505257)
I've really enjoyed working in Go (coming from a PHP background). The language is simple, and most of the time, code that's written in Go is just as readable/understandable months or years later as it is on the day you wrote it. It's a really enjoyable experience. I don't think it's a particularly good choice for GUI applications on any platform though. I've been down that road and it's pretty painful. For that, I'm learning Rust.
Re:Ask HN: What programming language should I learn next? by kim0 on Wednesday March 27, 2019 @04:42PM (#19505813)
Wish Go would get flutter bindings! How good is rust for gui bindings though
Re:Ask HN: What programming language should I learn next? by cweagans on Wednesday March 27, 2019 @05:57PM (#19506525)
I'll preface this by saying that I'm super new to GUI programming in general, but my best guess at the problems that I've been having with Go are that GTK expects all the UI code to be single threaded, and the Go scheduler will just move stuff around to different threads as it sees fit. In practice, this ended up being just one giant function with all of the handlers inlined as anonymous functions. Really gross. My troubles could also stem from lack of understanding of Go internals too.

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.

Re:Ask HN: What programming language should I learn next? by joeyrosztoczy1 on Wednesday March 27, 2019 @06:11PM (#19506668)
As a shameless plug, there are a lot of interesting perks for a generalist to using Elixir.

- 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)

Re:Ask HN: What programming language should I learn next? by akmittal on Wednesday March 27, 2019 @03:35PM (#19505038)
It depends what you do. Most of these languages are general purpose but might be better suited for specific needs.

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

Re:Ask HN: What programming language should I learn next? by nailer on Wednesday March 27, 2019 @03:39PM (#19505084)
To get a job right now: Go

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.

Re:Ask HN: What programming language should I learn next? by beckler on Wednesday March 27, 2019 @03:31PM (#19504999)
Sounds like you have a lot of experience with imperative and procedural languages.

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.

Re:Ask HN: What programming language should I learn next? by darshantejani on Thursday March 28, 2019 @03:34AM (#19510088)
Go for Go. Industries are adapting it like crazy! Plus good Go developers are scarce so as a freelancer, you will have increased opportunities. Also, to a fellow freelancer, I would like to suggest you making plugins for chrome and Wordpress. No matter how crowded their store looks like, there is still plenty of room of requirements. Here's my website https://boosters.in created on wordpress! I personally had to create a wordpress plugin for such a small website and small usecase. So I'm sure the world is full of possibilities. Have a good day!
Re:Ask HN: What programming language should I learn next? by aboutruby on Wednesday March 27, 2019 @03:58PM (#19505320)
Preaching what I like, and I'm not into extreme performance much:

- 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).

Re:Ask HN: What programming language should I learn next? by strzibny on Wednesday March 27, 2019 @04:20PM (#19505590)
OP said he already works with Python most of the time, so even if I live Ruby as the next guy, it's not a good recommendation.

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.

Re:Ask HN: What programming language should I learn next? by schappim on Wednesday March 27, 2019 @05:01PM (#19505986)
I use C++, Python and Ruby daily, but only Ruby showed me what truely poetic code looks like.
Re:Ask HN: What programming language should I learn next? by z0mbie42 on Wednesday March 27, 2019 @04:54PM (#19505929)
After a lot of C/jS/TS/Go I finally found my pleasure with Rust.

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.

Re:Ask HN: What programming language should I learn next? by samonzeweb on Monday April 01, 2019 @04:20AM (#19541470)
I definitely recommend Go. Not only for the language itself, but for the lesson about simplicity it provides. Sometimes developers using others languages uses and abuses of features to be productif, smart, ... causing more damage than benefict. It's not the way to do things in Go.

Go is multiplatform, and you can easily cross-compile for other OS or other CPU architecture. It produces a single binary then it's easy to deploy. It could be useful.

Go is really easy to learn, in a single day you will have a good understanding of the language itself. It's really something interesting to learn and practice a bit, without needing weeks of work. Even if it doesn't suit you, you had not loss many time.

Re:Ask HN: What programming language should I learn next? by lllr_finger on Wednesday March 27, 2019 @06:33PM (#19506856)
I've seen Rust mentioned, but not for the reasons I'm thinking of. My biggest complaint and simultaneously source of praise for the language is that it changes how you view other languages.

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.

Re:Ask HN: What programming language should I learn next? by smt88 on Wednesday March 27, 2019 @03:10PM (#19504799)
TypeScript first, as it will be like steroids for your day job.

After 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.

Re:Ask HN: What programming language should I learn next? by drallison on Saturday March 30, 2019 @12:37AM (#19527794)
Define and implement a compiler for your own language. Or implement a standard language or a subset of a standard language. Write the compiler in its own language or a subset that you can hand compile to, say, python. Nothing will give you a better appreciation of the nature of programming languages and their design. Not having to deal with types and storage management is cheating.

If you are simply cutting notches on your bedpost, write a utility or application in Haskell or Erlang. Even more instructive is to write a program in macro assembler.

Re:Ask HN: What programming language should I learn next? by patatino on Wednesday March 27, 2019 @03:01PM (#19504697)
How about dart? You have swift and kotlin on the list. With dart you could build native apps for ios and android
Re:Ask HN: What programming language should I learn next? by drivers99 on Wednesday March 27, 2019 @07:20PM (#19507282)
That's on his list of languages he's used. (It looks interesting though. I hadn't heard of it in a while and forgot about it.)
Re:Ask HN: What programming language should I learn next? by patatino on Thursday March 28, 2019 @02:17AM (#19509712)
I didn't see it! It looks very interesting in combination with flutter.
Re:Ask HN: What programming language should I learn next? by pornel on Wednesday March 27, 2019 @06:59PM (#19507100)
If you already know Python, Java and Dart, Go will be a breeze, so you can learn it anyway.

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.

Re:Ask HN: What programming language should I learn next? by 7373737373 on Wednesday March 27, 2019 @07:01PM (#19507122)
Have a look at http://norvig.com/lispy.html

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.

Re:Ask HN: What programming language should I learn next? by souprock on Wednesday March 27, 2019 @11:50PM (#19509074)
You're missing all of the assembly languages.

You're missing all of the HDLs. (Verilog, VHDL, etc.)

Re:Ask HN: What programming language should I learn next? by 0_gravitas on Wednesday March 27, 2019 @03:40PM (#19505100)
I've recently started learning elixir and it's an absolute joy to use so far
Re:Ask HN: What programming language should I learn next? by davidjnelson on Wednesday March 27, 2019 @03:25PM (#19504946)
Go is the most popular of the five you listed. Someone in my network who teaches at Stanford and worked at google said she is teaching her child go :-)
Re:Ask HN: What programming language should I learn next? by haolez on Thursday March 28, 2019 @01:43AM (#19509578)
Makefiles. They teach you a new way of thinking about code and dependencies and they are a universal tool that can be used in any stack.
Re:Ask HN: What programming language should I learn next? by tmaly on Thursday March 28, 2019 @03:12PM (#19515518)
What does the job market look for in your area?

Is there any industry you want to work in that requires a certain language?

What is the end result you want?

Re:Ask HN: What programming language should I learn next? by weatherlight on Wednesday March 27, 2019 @03:37PM (#19505054)
Elixir. It's the most different from what you know but has great online resources for picking it up.
Re:Ask HN: What programming language should I learn next? by euphumus on Wednesday March 27, 2019 @03:30PM (#19504990)
Scheme or Clojure
Re:Ask HN: What programming language should I learn next? by dominotw on Wednesday March 27, 2019 @03:51PM (#19505224)
Scala. Get the Manning book.
Re:Ask HN: What programming language should I learn next? by JBReefer on Wednesday March 27, 2019 @09:24PM (#19508226)
The weird thing about Scala is it's so nice and pure except all of the Object methods from Java, which sort of break the whole FP thing with it. I really want to love Scala, but it always feels 9/10ths of the thing.
Re:Ask HN: What programming language should I learn next? by carapace on Wednesday March 27, 2019 @06:25PM (#19506785)
Try Prolog.
Re:Ask HN: What programming language should I learn next? by mruts on Wednesday March 27, 2019 @06:09PM (#19506651)
Why don’t you learn some functional languages? Scala, Haskell, or OCaml. Or learning lisps is always interesting: Racket, Common Lisp, Clojure.

Personally, Scala is my favorite language.