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.
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.
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.
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 dont think sql counts as language in this context. Its more of an adapter for efficiency for most of the uses its best for. Don't get me wrong, it is a language but not at the layer under discussion.
I used to be a fan of polyglotism and knew a bunch of languages to various degrees of profiency. But the market pays much , much more for depth than breadth. The tools that pulled me into the quarter million paycheck territory were -
1. Good Scala - FPish Scala, coupled with Scala libraries such as Spark, mllib, scalaz, Scalding, Apache Math, colt, akka.
2. Bad Scala - Using Scala much more as an imperative lang, primarily for 3 purposes - shell scripting, web front-end html5 graphics and DOM manipulation with scalajs and web back-end with scalatra.
3. R - This one is not going anywhere in a million years thanks to Hadley Wickam and co. Now with SparkR I get to use #1 and #2 with #3.
My one desire is that Styla becomes a first class citizen in this ecosystem as well - when you need prolog, there is often no easy substitute.
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.
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.
Erlang - Because it handles scalability and reliability very well, is Actor based (each process being an Actor), has a great library for backend stuff in OTP, and because I love it.
Tie between Elixir (because scripting language that runs on Erlang BEAM), and Javascript (because it is so ubiquitous, despite having so many bad parts - though it has a fair share of good parts too).
Java - Because it is the modern COBOL...everyone hates it, but there are so many systems and shops that use Java that it becomes a de factor requirement to learn it.
Close runners up are:
* Clojure - Because it is based on Scheme, which is based on Lisp, and takes the functional approach.
* Python - Because the philosophy and syntax are beautiful
* Ruby - Because it is really fast to get web server stuff done
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'd go with practical and diverse if possible: Clojure, JavaScript, and C.
With clojure/JVM, you get a Lisp as well as good knowledge of java interop / apis, so you'll be able to work in Java if you have to, plus you get all the java libs, and there's basically a java lib for anything you could ever want to do.
Then I'd make sure you know JavaScript, its gotten to be a good enough general purpose scripting language, plus you'll be able to do anything you want browser side with it.
As your third I'd pick C since basically every other modern language / OS / low level lib is built on top of it. But it depends on how much you want/need to go down to that level. If you're just going to be doing web/mobile service development I might say go with something like Go, since it'll be more practical there.
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)
I don't know if one can be fluent only in 3 languages, but I'm in the rank of those who say that learn more will not harm you.
You can reason a lot about, but when you've to learn a new language, just for the pleasure of learning and because it will make you a better programmer, one thing counts: instinct.
I'm often inspired by a blog post, a snippet of code or simply a tweet that sings the praises of something!
I don't make forecasts for the future of a language, if it looks cool to me, I try play with it and see what's going on. (I think you can found practically any REPL on my laptop...)
Anyway I'll give my list of 3:
C# - Because I work with it from beta.
F# - Because I can use .NET knowledge with a functional-first language (and it helps me open the path to other functional langs).
Ruby - Because I'm still a fan of RoR and I love its KISS approach (and a smart dynamic language is useful for various tasks, e.g.: related to DBMS).
Others:
Erlang - It makes distributed computing "easy". I love vanilla Erlang, but other langs of its ecosystem are promising: LFE and Elixir, for example.
Haskell - Knowing it will make you better in every language.
Go - Because it's fun to work with it.
OCaml - Because I love ML syntax and I'm interested in all ML-family langs.
ELM - Because I prefer delegate to a transpiler the duty to write javascript.
PureScript - Same as ELM.
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.
C: performance (low-latency), system (interface to most kernels), game-dev
JavaScript: UIs
Remark that I would not consider these languages my personal favourites, but in fact, you do not have much choice. C is enforced as it is tight to *nix which is the most spread OS, JavaScript as it allows you to build cross-platform UI's (that do not require user-installation) and Python because of its huge library diversity (in particular in the applied sciences).
If you speak them sufficient you can tackle most problems. If you then want to go further I suggest
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.
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.
It makes me sad almost nobody mentions Perl and/or Perl6 (they are essentially entirely different languages, but designed by the same guy, so I'd say they follow similar design methodology). Although it is not as popular as it used to be, Perl is still extremely useful, and I found that the community around the language is by far the best and most welcoming to newcomers. Also a lot of people will say that Python is superior due to its readability, concise formatting etc., and indeed there are areas in which Python would be the better choice (machine learning and statistics to name a few) but for a quick file processing, OS admin tasks, or a simple multi-threaded web scraper, Perl would be my first choice. And I find that due to the flexibility and TMTOWTDI motto, I find the language much more expressive and I feel more creative writing Perl code. But I wouldn't dwell too much on picking the right scripting language, Python, Ruby, or Lua are all fine choices.
For lower level stuff and performance, definitely C++ and then eventually if you need it C as well, but I think it doesn't make much sense the other way round.
And as already said in this thread, it's good to pick up a functional language, just to broaden your horizon if nothing else.
I'm almost kind of serious. I had Ada in there, but C++ is building okay concurrency support, and is otherwise better at interfacing to other things. Maybe pull Fortran in favor of Ada? That's a thought. Not sure there are enough libraries in Ada.
Why these? Because you can build serious stuff. After awhile it gets boring writing yet another regular expression to parse yet another 'text file as database' blob thingy. I don't want to glue, I want to make what others glue together.
I can simulate rocket flight, planet formation, ocean temperatures, and predict the weather. I can write neural networks, do computer vision, deep learning. I can implement any type of database, implement Google search. I can write my own OS. I can hack a lot of this stuff together with Matlab, and then make it scream in C++ or Fortran.
Yes, C++, not C. I can write faster code in C++ (e.g. qsort vs std::sort), I can interface with both C and C++ libraries, and if I know C++ a pretty much know C by default. You can get to bare metal, or be more abstract. Why limit myself to learning C? Makes no sense. A lot of my C++ code looks like C, other times I use a lot of template magic. Depends on the needs.
I actually do most of my numerical stuff in the Python/NumPy/SciPy stack, and perhaps that is a better choice than Matlab. I'm being a bit contrarian to give contrast to the endless C/Python/JS answers, but Matlab does have a lot of libraries that aren't yet in the NumPy/SciPy stack. On the other hand, you can just write them in C and add them to Python if you need them. Trends are changing, but everyone I know that is into heavy math/algorithmic work is pretty handy at Matlab. I'm solely getting work to switch over to Python. Even then, down in the guts NumPy and SciPy are Fortran - you kind of need to know that stuff if you want to be a wizard and not a glue sticker.
Yes, I recognize this is a deeply individual answer that won't resonate with many. Variety is good, I think.
*edit: okay, Python/NumPy/SciPy stack wins over Matlab, even though STEM schools are still churning out Matlab jockeys. Like it or not, we do need to glue a lot of stuff together, and Python is fantastic at it. I'll leave my original answer here, as I assume the point of the thread is 'food for thought'.
First I will say, in addition to the 3 that I will mention, you should have some level of experience with Javascript, ES6 and Node.
This is due to the pervasive nature of javascript in web development, mobile,realtime and client side build systems.
That aside here are my choices:
For highly scalable, fast and realtime web apps
Elixir\Phoenix is my choice for its ruby like syntax, Erlang based language with
a framework that has built in websocket support.
Alternatively you can go with Golang or Scala\AKKA throwing in some Node for realtime capability.
For medium scale web apps, rapid development, building MVPs.
Python\Flask is my choice for an expressive dynamic language and flexible framework with big ecosystem of extensions.
alternatively you can go with django, ruby\rails or php\Laravel
For the enterprise, large project, large team, maintainable web apps
C# and ASP.NET 5\Signalr is my choice for a dynamically compiled, statically typed, decently scalable with async capabilities framework including websocket support that runs on windows and linux
1. Ruby - Productive dynamic glue language that gets things done. Chosen over Python because of jRuby and significantly better JVM integration than jython. jRuby opens up the entire Java ecosystem of both libraries and containers within your Ruby code but without having the productivity drop of having to do everything in Java to use it. Also chosen over the other JVM based languages because those are limited to the JVM where it might not be necessary or beneficial. Ruby plays in both worlds better than anything else and is surrounded by so many excellent tools for productivity, infrastructure management and server scripting that it is in my opinion, the best single language to KNOW. Not the best to do everything by a long shot, but it has the best balance of everything when all factors are measured; putting a premium on productivity because if you're going to be able to do that much you need to be able to do it in a timely manner.
2. PHP - There's a reason so much of the web is powered by PHP and that reason is simplicity for small stuff and dirt cheap hosting. PHP scales down better than any other language in that you can fill up a TB hard drive on a 512mb server and all of that code is going to run. It's too useful for the likes of simple sites to forgo, despite its other issues as a language.
3. Go - For high volume concurrency operations and other backbone "must be performant" code. That's where Go really excels and it's significantly faster to write this type of code with Go than with Java. Go just isn't there yet for your typical "websites" so it tends to be better for backend operations or APIs.
Note: I'm purposefully leaving Javascript off of the list because while it is necessary to know, fluency isn't required - similar to SQL. If either of those are list-worthy, then I'd choose SQL sheerly for scaling sake.
Well, this question has different ways it can be answered. Here's the approach I'd take to be versatile:
1. Javascript because there is no other choice for the browser. Even things that compile to JS will occasionally have you debugging the transpiled code to figure out what went wrong;
2. C. This is really C or C++ as you need something that's close to the metal and on some occasions nothing else will do. C probably edges out C++ in terms of versatility here;
3. Honestly, it'd probably be Java, which makes me sad. I'd like it to be Go but Java is just too ubiquitous and useful to ignore. It covers you for both a ton of web apps and Android development.
An alternative to (3) is really Python. The above list doesn't include any scripting languages, which is a weakness. Python covers this but really loses (first class) Android support. I don't like Python for large systems either.
For fun it might look a lot different eg Go, Swift and yes even C++. It really depends on what your goals are.
- 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.
Clojure is a powerful and simple language that gives you access to the jvm and the web. The community follows a composable library based approach to functionality which allows you to really understand how your stack works.
Rust, because it's a safer alternative to c/c++ but still allows you to be bare metal. Want to work on microcontrollers? No problem!
So combined Clojure and Rust fluency give you the ability to develop for pretty much everything and they are incredibly powerful in their own rights.
And finally c# because it's a nice language with lots of well paying jobs.
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.
Java, for choosing an object-oriented, static typed language.
Ruby, a dynamic scripting language that I love its syntax, but maybe python would be a better choice for general dynamic scripting language, not because I like it, more because of its ubiquitousness.
And finally Clojure, because it's a member of Lisp family and I always wanted to try one of them, and by running on the JVM it inherits great amount of Java libraries.
C++ - yes low level programming, stable, lot's of resources, general usage and lot's of great libraries.
Python - Modern and easy scripting language. This to me is the swiss knife (and replaced Perl) of modern scripting programming languages. It can be used in nearly every project.
Swift/Rust - Both are great languages, I believe both will have a great future maybe Rust will take more time to gain traction.
1) Erlang/Elixir - For when I need to tackle concurrent/distributed problems.
2) Clojure - Ensure I'm able to be effective on the JVM; Clojurescript allows me to be effective in the browser.
3) C - For when I need to do systems programming, interact with low level drivers, etc.
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
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.
F# - Functional language where you can cheat more than haskell if you need to. Can use all the .net ecosystem and works everywhere (linux, windows, mobile, can compile to js.)
C - Pretty much everything is built on top of C right now.
Javascript/html/css (using Flow to add a robust type system, since dynamic typed languages are shit for long term ease of development)- Required if you want to do anything web plus its the only true cross platform GUI to use on top of your F#.
> F# - Functional language where you can cheat more than haskell if you need to. Can use all the .net ecosystem and works everywhere (linux, windows, mobile, can compile to js.)
How can you cheat more than Haskell? Couldn't you just put everything in IO in Haskell to get the same (or at least similar effect)?
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.