Ask HN: You can only be fluent in 3 programming languages. Which ones?

42 points by dattl ↗ HN

74 comments

[ 3.7 ms ] story [ 135 ms ] thread
I don't think there's a reason to be limited to 3 programming languages. Perhaps you can only be fluent in 3 languages at once, but knowing more languages is definitely not harmful. I know more than 10 languages to a degree where I have written at least one non-trivial project with them. I can't claim to be fluent in all of them at this moment, but I can quickly ramp up to a productive level in a matter of a few days.

Now if I had to pick three languages, they would probably be something along the lines of:

1. C. This language has been relevant for 40 years, and will remain relevant for at least another 40 years. Low level understanding of computer operation is paramount for a lot of advanced tasks.

2. Python/Ruby/Lua. A dynamic "scripting" language is very useful to get stuff done quickly when you need it.

3. A functional language: Haskell, ML or Lisp. Knowledge of this paradigm will make you a better programmer, regardless whether or not you get to use it in your day job.

There are languages I'd like to add to this list, namely something like Java/C# (a "managed" imperative language). And then some "brain teaser" languages to expand your horizons, Prolog is a good one for a rainy weekend and doing some simple Brainfuck programming because Brainfuck is to Turing machines what Lisp is to Lambda calculus.

But I disagree with the "3 languages" rule here, I'd recommend trying to learn a little bit of a new language every year. Next on my list is Rust.

"But I disagree with the "3 languages" rule here, I'd recommend trying to learn a little bit of a new language every year"

Absolutletly agree. By the way, an interesting language to learn is Smalltalk.

"I often feel that the American programmer would profit more from learning, say, Latin than from learning yet another programming language." -- Edsger Dijkstra https://www.cs.utexas.edu/users/EWD/transcriptions/EWD06xx/E...
Dijkstra was a great scholar, but often very extremist in his thinking; probably he was well aware of his extremism and even use it as a tool to over correct some issues.

For instance, he was very right about the goto abuse but the idea of removing a powerful tool from your belt just because can be abused is a bit too much. Here I suspect is happening the same, he was concerned about people learning a lot of languages but not mastering a single one, still that doesn't negate the advantages of master one language and learning more.

(comment deleted)
1) Javascript. The ecosystem, libraries and usecases covered now are enormous, from dynamic websites to mobile/desktop apps - everything is doable.

2) Elixir. Distributed systems, embedded software (IoT networks), critical/reliable web services and backends.

3 some systems level language (either Rust or C, Go is too laughable as a language for me and google stuff in general isn't something I can recommend any longer)

- C - Python - JavaScript

This is, of course, only based off of what I know so far and what I would find most useful. I could probably trade JS for a SQL, though, if I was thinking purely in terms of work that I'm into now. I don't use C at all, except to look at Python bindings occasionally...but all the concepts I've learned from learning C are vital, even when working with high-level languages. Plus, it'd be nice to switch to iOS development at some point.

I second this, although my order would be:

1. Javascript

2. C

3. Python

Does Assembly count as one language? If not, then

1 JS

2 JavaEE

3 C

If yes Assembly goes to the top

OCaml, Rust, C.

- OCaml: my favorite (at least at the moment) functional programming language and a very good choice when writing compilers and static analyzers, which is my main research area.

- Rust: a safe system programming language with a lot of good ideas imported from languages that I respect, and also with its own new things (i.e. borrow checker). I feel it's going to be a very important language in a few years.

- C: although I predict that Rust is going to become very big, C will always be there. Though not my favorite language by a long shot (I'm way too bad a programmer to be expected to handle it properly), its importance can't be denied and being knowledgable in C will be a skill that will be useful and desirable for a long time.

Something at the back end, JavaScript plus a crapload of frameworks, libraries, build tools, development tools, database query languages, cloud services, your IDE and deep Linux.
Ruby, Swift and Javascript. Assuming Swift, once open-sourced, gains popularity outside of Mac/iOS development, these three languages have you covered pretty much completely (besides really low-level stuff, of course). These three let you build server-side apps, web applications (including client-side code), mobile apps (iOS) and desktop apps (Mac).

That said, whilst programming languages are fun to learn and tinker with, I find a lot of people give them too high a priority (hence you hear stuff like "now that Swift is open-sourced and available on Linux, iOS developers will be able to easily write Android apps"). Compared to UI frameworks like Cocoa, etc, a programming language is very quick and easy to learn.

I'm singling out your post because of how "scripting language"-weighted it is. (Minus Swift.)

Ruby makes for a pretty slow server side language. It's appropriate when moving fast, but at scale it's rather icky. Your other languages seem to fill anything it can do.

Have you considered Go, Java, Scala, C#, etc.? None of these are "low level".

That's why I included Swift. Now that it is going to be open-sourced and available on Linux, it will - hopefully - become a good replacement for Go / etc. Will have to see how the community evolves, of course. Currently I use Go in certain situations but I'm hoping to eventually be able to replace it with Swift - will just have to see how things progress.

Disagree though about Ruby being icky at scale. Whilst some companies have moved away from it as they have gotten bigger, there are tonnes of companies that are still using it successfully.

I also disagree that the other languages cover Ruby's uses. It is an incredibly flexible and powerful language and has an incredible assortment of very well written and very well maintained libraries - far exceeding any other language I've used. Plus, having used many other web frameworks, I'm afraid nothing is as good as Rails. Some, such as Django, come close - but nothing quite beats it.

That said, it all depends on your use cases. I'm mainly a web programmer, building web apps, APIs and the occasional mobile app. I'm not dismissing other languages by any means, but these are the languages that I would personally keep if I had to throw away my knowledge of all programming languages but three.

Haskell, Clojure, C.

Currently I'm fluent with Ruby, Haskell and JS.

Both Haskell and Clojure are compiling to JS nowadays. I dont want to be "fluent" in JS for that reason, just know enough to debug the occasional problem.

1. Rust - Low level systems programming. It has a ways to go, but it is so pleasant to write. In reality this has started to replace my usage of C++.

2. Javascript - Both a scripting language and the Web language. If it weren't the lingua franca of the browser I would much rather choose Python or Ruby instead.

3. Java - A typesafe, managed JVM language perfect for writing microservices, Android apps, etc. For anything bigger than would be appropriate for a scripting language or that must be maintained by several people. Java hits the sweet spot.

Scala, C, Javascript.

Scala covers mainstream OO-programming and Haskell-style modern functional programming (monads, higher-kinded types). Moreover via Akka you have access to Erlang-style distributed programming.

C is vital for low-level programming like operating sytems and network stacks. C might be replaced eventually by Rust but if that happens at all, it will take at a decade or so.

Javascript is without competition for anything in the browser.

All three languages have vast library and tool ecosystems at their disposal.

(comment deleted)
It would be: C#, Javascript/Typescript, C++
Kernel - The most abstractly powerful langauge I know (ie, Blub). It's trivial to implement the behavior and semantics of other languages in, and very few restrictions on how to do it.

C - For interfacing with existing systems (POSIX, OpenCL, OpenGL etc) which would be too much effort to reproduce.

I struggle to think of a third which I'd absolutely need (other than assembly), so I'll opt for VHDL - for when we need to break free of the shackles of our CPU.

Thank you for pointing Kernel. I never heard about it but it looks powerful. Have you built something with it?
C, JAVA, Python

I'm writing as a mostly server side developer: - C: It is good to know low-level programming. (ASM would be a good pair). C is prevalent: Linux kernel is written in C. - JAVA: if you want cross-platform and GUI - Python: if you want something quick and dirty

Python - C - Javascript/DOM

Python - Python is by far the best 'glue' language out there. There are things Python isn't good for, bit it's far far easier to replace the performance critical bits of a python impl with a faster module, than the other way round

C - Gives you a good understanding of what the actual impact of each line of code has. Unlike ASM, it's still fairly approachable, and useful at scale. Unlike Java, you retain a good feeling of the instruction-level impact of each statement you make

JS/DOM - HTML + Javascript is the future of user interfaces (for the next 5-10 years anyway). QT/GTK/Win32/IOS/Swift all have their places, but for a dev speed / cost-benefit payoff point of view, just do it in HTML. A deeper understanding of the DOM API will allow you to make better choices that mean you don't end up with a sluggish, unusable interface

I'd swap Python for Ruby because of the dramatically better JVM support and the number of tools the Java ecosystem opens up...without having to learn Java. Ruby plays in JVM and non-JVM land better than Python and it's almost entirely because Ruby benefits significantly more from running on the JVM than Python does.
Python's support for scientific computing is far superior to Ruby's though. Horses for courses.
And the winner is.... Javascript. Makes sense if you want to write code on the platform(s) that reaches the most people you have no choice.

It's telling that its not about the language but how you can use it.

It also nicely demonstrates that a huge fraction of HN consists of web developers.

I think I've used Javascript once in the past 10 years or so. I work on all sorts of interesting stuff in five languages (C++, Rust, Python, Lua, Swift), just not on the web.

Same here, but in a much shorter time frame of four years as a developer. Javascript isn't even on my radar right now at work or even at home.
Haskell: for when I want to think.

Python: for when I need to get stuff done.

C: for when I need to talk to hardware.

1) C, for the low level concepts and fundamentals it bestows the programmer.

2) JavaScript, because if learning one language, such as C, is important, so is learning a language on the other end of the spectrum. And in some important ways JavaScript stands opposite C. Learning both forces the programmer to understand managed vs. unmanaged, working with and without a compiler, strict vs. dynamic typing, deploying a binary vs. a web app, etc. Those are all opposites programmers should gain experience with at some point.

Plus, JavaScript's ecosystem is just too rich too ignore.

3) SQL, b/c working with databases and relational data has always been important, and that won't change.

I will suggest 3 languages, but first, if you could only be fluent in one language, I would argue that Clojure would be a very good bet: practical, huge number of libraries (native and Java interop), with Clojurescript you can get by without being a Javascript expert, and the good libraires for web programming.

Otherwise, it depends on what your main task is; possibilities: front end web, Anroid, iOS, back end web services, data science, etc.

In general, you need a scripting language. I prefer Ruby, but if you need to do data science, machine learning, etc., choose Python. A scripting language may suffice for web development also.

I am a proponent of learning Java. The Java ecosystem is huge and there is a lot of good stuff.

Choose an esoteric language. I personally like Haskell, Smalltalk and Lisp languages.

One from each of these groups:

LISP/Scala/Clojure/Erlang/Haskell/Prolog

Python/Perl/PHP/Ruby

Java/Javascript/C/C++/Go

For extra credits one from:

FORTH/Smalltalk

That should get you enough of a grip to pick up the remainder easily and when needed.