

If you could only learn three programming languages, which would you choose? - egor83
https://spreadsheets.google.com/viewform?formkey=dC0zRkR3U1kwYVRvZW9fa3ZNaEVreGc6MQ

======
jrockway
Three is a good number.

C needs to be one of them, because everyone writes their libraries in C, and
you need to use them and be able to contribute your own libraries. Don't use C
for applications, though; there is no performance gain (gluing C libraries
together in C is as fast in $foo as it is in C for most values of $foo), and
there is a maintainability and expressiveness loss. Libraries are simple
enough and small enough in scope that this doesn't matter. Your HR org-chart
editor web app? Not so much.

So I use C for libraries that other people need to use, but nothing else. This
way, I get code reuse without having to force a "policy decision". Everyone is
fine with C and it integrates well with pretty much every other programming
language.

After C, you need a language for high-performance but moderately complex
applications. This language needs to allow for expressive description of high-
level tasks, but it also needs to expose primitives for writing "fast" code. A
lot of people choose C++ for this, but I think C++ is a bit too low-level for
application development. Most people choose Java or C#. (I hate both, but it's
close to the right thing.) I use Haskell; other good options are OCaml, F#,
Common Lisp, etc.

I use this class of languages for things like ETL or network-based computation
services. The code is a little complex, and it needs to run fast. This family
is perfect for that.

The third language you need to know is a "scripting language". This is a
loaded term, because scripting sounds like it's not real programming. But this
is wrong, making a Perl script to filter your email is just as "real
programming" as writing the TCP stack for your OS. If you have a problem you
want to solve and you type some stuff into a computer so that it learns how to
solve the problem, that's programming.

I use Perl, but obviously there are a lot of options here; Perl, Python, and
Ruby are the best choices, followed by Lua, various Scheme implementations,
and so on. I picked Perl over Python and Ruby because they all really suck
performance-wise, but at least Perl has a great community and a great library
repository. It doesn't really matter which you choose, as long as you love it.
(My favorite color is green. Yours may not be. Let's not argue about it,
though.)

This class of languages, in general, is best for building complex applications
where maintainability is the core requirement. Scripting languages give you
the tools to design and build incredibly flexible abstractions that let you
hide a lot of complexity where appropriate. They also make it really easy to
write great tests, and to implement new ideas. Being unafraid to refactor your
code and being able to design abstractions to refactor into are the keys to
maintainability. And languages like Perl make that really easy.

Lately I've been playing with node.js, which I really like for "quick scripts"
that need to be event-driven and need to talk to the network. I'm hesitant to
include it in this category, though, because it lacks good namespace support,
which makes writing complex apps tough. It also doesn't have a mature
toolchain yet. But it is cool and if you have done web programming but haven't
done any "scripting", you can get started and start having fun quickly. So do
check it out.

(Also worth noting; I've written event-based network services in all three
classes of languages. The performance is the same regardless of which you
choose! Nothing is slow for IO; the plumbing is all handled in some generic C
library and the OS. C is fast, Haskell is fast, Perl is fast, and node is
fast.)

Finally, if you do web stuff, you need a fourth language that compiles to
Javascript, just because that's how the web works. I think plain Javascript is
fine, so I use that, but coffeescript and friends are also cool.

~~~
eru
> I picked Perl over Python and Ruby because they all really suck performance-
> wise, but at least Perl has a great community and a great library
> repository.

I recently learned that Lua is pretty fast, according to anecdote and shoot-
out data. I did not like the syntax, when I last looked at it. But I might
change my might. I mostly use Python for this class of things at the moment.
Though I could see myself use Haskell more.

We use OCaml at work for your first and second category. (We do interface with
C, too.)

~~~
silentbicycle
Lua's other strong point here is that it has an especially nice C API. Unlike
Perl, Python, and Ruby, it was written _primarily_ to script C, with use as a
standalone language being secondary.

I prefer Lua to all of those, but that again is a matter of taste.

And yes, Lua is pretty fast, and LuaJIT (<http://luajit.org/>) is so fast that
it's a major outlier among scripting languages.

------
egor83
A follow-up to the discussion of the results of similar survey at
<http://news.ycombinator.com/item?id=1982903>

We had a poll for that (<http://news.ycombinator.com/item?id=1983229> ), but
it diverged a bit into answering "which ELSE three programming languages would
you learn" and natural languages discussion.

EDIT: If you choose "Other" from the list, could you please add a comment here
saying which language would it be?

EDIT2: live results:
[https://spreadsheets.google.com/ccc?key=0AgDNp1TM4umedC0zRkR...](https://spreadsheets.google.com/ccc?key=0AgDNp1TM4umedC0zRkR3U1kwYVRvZW9fa3ZNaEVreGc&hl=en)

I'll sum it up and post the results later.

~~~
rednum
Also discussion covering similar topic ('The 3 Programming languages you need
to know'): <http://news.ycombinator.com/item?id=1893000>

------
timinman
The graph images in the report aren't loading because they are being requested
at too large a scale. Something like:
[https://www.google.com/chart?cht=bhs&chs=305x900&chb...](https://www.google.com/chart?cht=bhs&chs=305x900&chbh=24,6&chco=9b9bf3|1515e3|9090f2|8b8bf1|0505e1|5b5beb|a0a0f4|2b2be5|5656ea|7676ee|5050ea|4646e8|4b4be9|8686f0|0b0be1|6666ec|4040e8|3b3be7|6060ec|7070ee|7b7bef|6b6bed|3030e6|3535e7|8080f0|1b1be3|1010e2|2525e5|2020e4|9696f2|0000e0&chxt=x,y&chxl=0:|0|19|38|57|76|95|1:|----%20Other|VimL|Visual%20Basic|SQL|Smalltalk|Shell|Scheme|Scala|Ruby|Python|PHP|Perl|Pascal/Delphi|OCaml|Objective%20C|MATLAB|Lua|Lisp|JavaScript|Java|Haskell|Groovy|Go|Erlang|COBOL|Clojure|C%23|C%2B%2B|C|Awk|Arc&chxs=0,000000,12,0,lt|1,000000,12,1,lt&chds=0,95&chd=t:8,1,94,50,19,6,0,8,2,0,21,20,29,35,0,1,5,0,2,4,6,66,23,4,9,0,2,4,0,0,5)
works.

------
tumult
You've included many redundant languages while simultaneously excluding
several classes of languages. Many of your other decisions seem odd.

C/Pascal/Delphi are not so different from each other. C++/Java/C# are not so
different from each other. PHP/Python/Ruby/Perl/Lua/JavaScript/Shell are not
so different from each other. Arc/Scheme are not so different from each other.

You've neglected the APL family of languages. You've neglected the Prolog
family of languages. You've neglected the Forth family of languages. You've
neglected languages in the family of theorem provers, such as Coq, Agda and
ATS.

You've also made some other strange choices. Scala and OCaml but not Standard
ML? Smalltalk and C++ but not Simula? Groovy, which nobody will remember in
three years, but not Fortran, a timeless classic still in wide use today?

~~~
tzs
> And SQL isn't a programming language.

Sure it is:

<http://wiki.postgresql.org/wiki/Mandelbrot_set>

[http://assets.en.oreilly.com/1/event/27/High%20Performance%2...](http://assets.en.oreilly.com/1/event/27/High%20Performance%20SQL%20with%20PostgreSQL%20Presentation.pdf)

~~~
tumult
I stand corrected.

------
jamii
I'm starting to get annoyed with the way google translates pages based on my
ip and then offers to translate them back based on my browser settings. This
is sub-optimal.

------
bryanlarsen
Three is a bad number. Three is the minimum required to do your job, so
doesn't let you choose any cool languages that blow your mind and make you a
better programmer.

\- you need to know C. All your infrastructure and fundamental libraries are
built in C. If you can't read the code or fix bugs in your infrastructure, you
need to hire somebody else who can. (N.B. if you work in an environment where
all your infrastructure is in Java, you need to learn Java instead. If you
work in an environment where all your infrastructure is Microsoft, you're
screwed because that's not open source).

\- you need to know Javascript. It's running on all of your client's desktops.

\- you need to know a glue language. Probably sh, but Perl works too. Python
and Ruby are alternatives, better in some ways, worse in others.

Those are the three you need to do your job. But if that's all you know,
you're not doing a good one. For instance, the best way to become a good
Javascript programmer is to learn Lisp.

~~~
jamii
> you need to know Javascript

 _You_ need to know javascript. There are a lot of industries where you can
live without it. It certainly doesn't make it onto my top three.

~~~
bryanlarsen
Name one. I'm willing to bet you've got your head in the sand. I work in the
embedded industry. A significant minority of these devices are shipping with
web servers on board for command & control. The price difference between an 8
and 32 bit micro is dropping quickly.

So you might be able to get away without knowing Javascript, but you'll need
somebody in your company who does, so my original comment stands.

------
rquesada
The question needs more context, like" "if you could only... to get a good
job" "if you could only... to understand the roots of programming" etc..

For example, to have a better understanding of programming I would chose 3
different paradigms: \- an object oriented language. eg: Smalltalk \- a logic
language. eg: Prolog \- a functional language. eg: Haskell

But if I would want to get a good job I would chose Java, C# and Objective-C

------
drblast
Well, if this proves anything, it proves that not even three languages cover
every problem.

Which is strange. In most other endeavors you'd think being fluent in three
similar ways of doing something would be enough.

FWIW, I'd choose Lisp, Javascript, and C. But I'd be writing an assembler as
my first project and a database interaction language as my next. And now that
I think about it, my database language would look nothing like SQL...

------
JoeCamel
R and language of TeX. They are not on the list.

------
dnot
Not only am I unable to choose, I can think of nothing else since I've read
this.

------
duck
Each time one of these "surveys" comes up I am surprised by the number of
Python vs Ruby responses. It seems to always be 3 to 1 in favor of Python
while I had thought the usage was more like 50/50.

~~~
Symmetry
Are you involved in web development? It probably is about equal there, but
where I work we have a substantial contingent of people who use Python on top
of C or C++ for hardware control or who have switched from Matlab to Python,
but I don't think I know a single Ruby user.

------
wslh
First it's important to note that the importance of programming languages is
time sensitive, it depends of current programming language maturity and their
related tools: VB was a success mainly because the IDE gave a lot of power to
[below] average developers.

In my opinion:

i) C#: It's the most advanced general purpose programming language. ii)
Python: Excelent scripting and glue. iii) Javascript: It's the Web!

But for system programming...: i) Assembler ii) C++ iii) Python. It's good for
Reverse Engineering too!

------
tzs
It's a bit unclear. Is it assuming I'm starting from knowing no programming
languages, or is it asking which three programming languages I would learn in
addition to the ones I already know?

~~~
coffeeaddicted
And order of importance or order in which one would learn them?

~~~
danparsonson
I just picked my choices in alphabetical order - perhaps the results for the
three choices should be aggregated.

------
d0m
Scheme/Python/Javascript (Mainly to be able to do a little bit of everything -
and scheme to make you learn to think out of the box)

However, Arc and Haskell are fun to learn.. and you also need some
C/C++/Java/C# background otherwise you're not serious right? Then, with this
knowledge, it'd be a bit weird not to know Ruby and Perl. And some
bash/sed/awk is required to work on a unix box.

Damn, I hate those pick "three programming language" questions.

~~~
dlsspy
javascript has way too much in common with scheme. python is practical, but
not different enough to really _teach_ you much.

I program in three languages on most days (though not the same three all the
time). These artificial constraints are difficult.

------
arnorhs
Do you mean if I could only learn three languages that I don't know yet or are
you talking about which language I wouldn't want to be without ?

~~~
egor83
The latter.

------
dqh
I was intrigued that my answers for 1,2 & 3 are the most popular. I answered
1:C for simplicity and an an appreciation for where we've come from. 2:Python
because i've never felt as free to express as when using python. 3:Javascript
because it's practical to learn it.

For others who answered C->Python->Javascript, what were your reasons?

~~~
portmanteaufu
I answered Python->C->Javascript, but I'll pretend I was invited anyway. :)
Python because I enjoy it the most -- if I had to be stuck with a single
language, Python would be it. Even if it doesn't run the fastest, its library
set and readable syntax make it very endearing to me. I picked C next because
it's the obvious choice for speed and systems programming. The fact that you
can write libraries for use in many other languages in C is also very
appealing. Finally, knowing Javascript lets you contribute to the web. It's a
great scripting language that I think gets a lot of flack from people that had
to use it in the days before great toolkits like jQuery. While I'd like a
choice in front-end scripting languages as much as the next guy, I've come to
appreciate JS for what it is.

------
ankushnarula
I was bored so I copied your spreadsheet and created my own summary:
[https://spreadsheets.google.com/ccc?key=0Al3XiYsO01iIdEJRMnU...](https://spreadsheets.google.com/ccc?key=0Al3XiYsO01iIdEJRMnUwOVRKX1NqVmpyZzdCN0tLZ2c&hl=en&authkey=CLncn_MP#gid=3)

------
derefr
Are programming languages really discrete, though? If you learn Scheme, then
write Arc in it, do you now know Arc, or do you still just know Scheme? If you
Greenspun in C, do you still only know C, or did you "learn" (half of) Common
Lisp?

~~~
Goladus
No, they aren't discrete. This is a silly exercise but fun to play.

------
jaekwon
as always, javascript being neglected. poor old ubiquitous javascript.

~~~
egor83
Thanks, good point - I guess I should've started with 'Other'.

As for arc-arc-arc answers - one out of 62 so far.

EDIT: I answered to the previous version of the parent.

~~~
russellallen
Well at least you know pg's voted.

~~~
egor83
How do I know that?

~~~
russellallen
Woosh? :)

Btw, how do I see the current tally?

~~~
egor83
[https://spreadsheets.google.com/ccc?key=0AgDNp1TM4umedC0zRkR...](https://spreadsheets.google.com/ccc?key=0AgDNp1TM4umedC0zRkR3U1kwYVRvZW9fa3ZNaEVreGc&hl=en)

~~~
ankushnarula
How about posting a link to the form's summary page instead?

~~~
egor83
Will do, on Monday morning.

------
jules
No x86 assembly? No F#?

~~~
egor83
Actually, I thought about including both (along with Fortran and Algol out of
respect for the old school), but I had to stop somewhere.

Well, that's what "Other" is for.

~~~
jules
Okey, I submitted "other" "other" and "other": F#, LLVM IR, and x86 assembly.

------
egor83
Results: <http://news.ycombinator.com/item?id=2000534>

------
rednum
It would be useful to filter out Arc-Arc-Arc and Foo-Arc-Arc answers,
obviously they are irrelevant

------
snth
The images (I assume they're graphs?) are broken for me.

~~~
egor83
Yes, but it's Google's stuff, and I don't have a direct access to that.

I'll sum it all up and post the results some time later.

------
keefe
java, c++, javascript

you can do everything.

~~~
jrockway
Except maintain anything you just wrote.

~~~
keefe
so here I have a great IDE, lots of static analysis, continuous integration,
automatic dependency management etc... people who say you can't maintain java
don't know how to code in it, after 13 years it's clear to me why it's still
popular.

------
tzury
c, python, haskell

~~~
meric
c, lua, clojure

------
arnorhs
It's missing Node.js

