Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Poll: How many programming languages do you command fluently?
25 points by jonsen on Jan 4, 2014 | hide | past | favorite | 44 comments
I once heard that the record for natural languages is 104 and wondered how many programming languages it's possible to command fluently. Well, records aside, it would be interesting to know the distribution for the HN clientele.

How many programming languages are you able to use effortlessly to produce nontrivial programs?

2
155 points
3
110 points
4
82 points
5
73 points
1
54 points
none
40 points
6
31 points
more than 10
27 points
7
12 points
8
12 points
9
4 points
10
3 points


Absolute numbers aren't really all that interesting. Much like human languages, the differences between programming languages are not all equal. I've been told by native Italian and Spanish speakers that, even absent any formal training, it's relatively trivial to become conversant in the other language. My wife is a native Turkish speaker, but she can tune in to the Azerbaijani news channel and understand everything the announcers say, though reading is essentially impossible (modern Turkish uses a modified Latin alphabet while Azeri uses Cyrillic). However, as a native English speaker learning Turkish, I can vouch that it's significantly more difficult than when I was learning French or German. (Turkish is, interestingly, something of an outlier when it comes to language families.)

Likewise, anyone capable of writing a program with Ruby should be able to pick up Python in a day or two. Java and C# are, for the most part, just a few syntax conventions apart. What's more impressive is if you can code, competently, in a pure object oriented language as well as a pure functional one.

If you already know Ruby, I'd wager your time would be much better spent learning Clojure or Haskell than Java or Python.


That's what I was thinking. On the one hand is the C family of languages (C, C++, Java, C#, Go) and then you can get mileage from the Lisp family of languages (Lisp, Scheme, Racket, Clojure) - you can get a lot of languages there but you're still only working within two language families.

Throw in some Haskell, Forth, Prolog and now you're getting interesting!


Very vague, ill defined question. You've not defined what you mean by 'programming language', nor 'program', nor 'nontrivial', etc.

Most people are probably using a bunch of languages without realizing it (SQL, Bash, Make, Tex, Regex, Yacc, etc) which aren't necessarily general purpose but can produce nontrivial programs. Also, there's no clear distinction as to what makes a `general purpose` language, so it would still be unclear if you limited the scope of the question.

I know a bunch of different assemblies and a bunch of lisps, but I don't consider them each unique languages. It'd perhaps be a stretch to consider C#, Java, Vala, D and C++ as unique languages too, since they're mostly different dialects of the same language (i.e, primarily imperative OOP with generics and iterators). I don't really need to change the way I think when switching between these languages, only remember the variations in syntax and vocabulary, but using the same ideas to reach my goal.

On the other hand, I've switched to using functional languages in the past 5 years or so, and it has massively changed the way I think. So much that I struggle to 'effortlessly produce programs' in OOP languages because they lack the capabilities I've come to expect, but I'm no less 'fluent' in them.

I'd go as far as saying that the distinction between named language with syntax and a library or API is pretty vague too. For example, I'd consider OpenGL to be a language, although it's just a bunch of functions and types which behave the same in whatever syntactic face you use. One could argue that any API is actually a "DSL" (popular term which means basically nothing.)


I was bothered by your question, mostly because of the word fluently. I was hoping you would define that word in your comment. You did:

"How many programming languages are you able to use effortlessly to produce nontrivial programs?

I see this as a different question entirely, as I'd question whether a non-trivial program can be done without effort. Making I'm taking this too literally, but then what are you really wanting to measure?

So, what are you really asking? How many languages could we sit down and program with, and spend time programming rather than Googling? Or is it really "How many programming languages are you able to use effortlessly to produce nontrivial programs?"

Personally, I like to think of it as how many languages am I comfortable using to employ it in a production environment and support it for money. This means I know more than just the language, but the ecosystem and environment as well. After all, learning objective-c is easy. Learning all the cocoa frameworks? That will take much longer. Learning all the frameworks without needing to reference the documentation? Hah.


You can say that you are fluent in i.e. english even if it takes you some effort to formulate some arguments. I'd say you are fluent in a programming language if you can effortlessly write a program even if it took some effort to solve the problems per se.


I have never, in any language, on any project, in my life not needed a man page or some sort of knowledgebase or library data sheet.

When I speak English, though, I never need a dictionary.


English is my first and only language and I still need to reference a dictionary when reading, you can be fluent but still need a reference.


"When I speak English, though, I never need a dictionary."

You make a staggering number of syntax errors, grammar errors, and use a huge number of poorly defined referents that only work because your listeners are human-intelligent agents who can work it out from immense piles of context and cognition. That's not an attack; I do too. Everyone does.

If computers were smart enough to deal with "I need a windowing umm umm thingy yeah like a window but with a title bar that said uhh my name uh then uh uh then make it really ummm big like fulling on uh up the screen", we'd probably be able to program for longer without Stack Overflow too. :)


That's a very true. Thanks for the response!


The question didn't define "fluently" as "never needing to look anything up." I think the concept of fluency (of any kind of language) is being able to use it without significant effort. e.g. I would consider myself "fluent" in Java, but not Lua - that doesn't mean when I write Java I never have to look anything up, but certainly far less so than hypothetically writing the same thing in Lua.


0 ... I don't thing there is any language I know that I haven't had a gotcha moment in the last 12 months.

But I suppose I could write FORTRAN in any language given access to stackoverflow.


Ofcourse, added option "none".


Effortlessly? Hmmm... 0, depending on exactly how you define "effortlessly". But if I understand the spirit of the question correctly, I'd say there are 4 or 5 languages I can be productive in without essentially having to learn the language and associated libraries from scratch. Offhand, I'd offer up C, C++, Java, Groovy and Javascript as languages I'm at least moderately competent in. I could probably still write Python without too much trouble with a couple of days to knock the rust off.

All of that said, if you asked me to write a non-trivial program starting today, and I had to optimize for productivity, I'd pick Groovy.


> C, C++, Java, Groovy and Javascript as languages I'm at least moderately competent in

When I had only used this subset of languages, I found Groovy the most productive. But when I tried out others afterwards, I found...

1. Clojure and Haskell seemed to be top of the pyramid. Between them, they have the most functionality you could ever hope to get out of any two chosen languages.

2. Ruby and Groovy did the same things, tho Ruby came first. Nowadays I'd call Groovy a JVM-based dialect of Ruby, but with different lexical tokens. Unless you're using it with Grails, why not just use the more popular one?


heh, totally forget that I once knew Groovy, thanks for the reminder.


The tough part is the standard libraries.

Syntax and semantics can be picked up really quickly. I could read and correctly modify code in a dozen languages. I could produce a scheme interpreter in a bunch of languages without much hassle, but if i don't pick the domain, i'm just not fluent.

I like to think i'm strongest with Java. There's a bunch of standard libraries i understand really well, but there are so many dark corners. For example, I'm aware of the existence of the x509 crypto stuff, but it would take me a while to use it correctly.


I think idioms are kind of hard too. The little things can get annoying quickly. For instance I frequently am told I write my java in C# (and amusingly vice versa). The idiomatic way of capitalizing is different between the two. Similarly when doing C++ stuff I tend to name things in C. And so on.


I only picked 2 because every language I know besides PHP and Javascript (Java, C++, C#, VB and Python) I only know through study, and I have yet to do anything useful with them. Other than pass classes.

And this (not exactly non-trivial though): http://www.codeskulptor.org/#user14_OI6cFSxxCICXtA5_37.py


"How many programming languages are you able to use effortlessly to produce nontrivial programs?"

To be totally honest with myself I had to answer "none," although the answer to "how many programming languages are you able to use with moderate effort..." might have been in the 3 to 5 range, depending on your definition of "moderate." For example, even though I'm "fluent" with Java The Language, I find writing non-trivial programs with it often somewhat painful, usually due to struggles with various aspects of the ecosystem like hibernate, Spring, etc... Or, even though I could crank out a Python script pretty easily, I'm not sure I could do something "non-trivial." (Hell, if I even had to use argparse I'd definitely have to re-read the docs...)

A more objective way to frame the question would be something like "How many languages can you write fizbuzz in under N minutes without using google?" or something along those lines.


Yes, there's as many ways to understand the term "effortlessly" as respondents.

Understanding the question as "how many programming languages I had used in the past to produce nontrivial programs and would likely be able to do this again with little to no refreshing my knowledge", my answer is 8: Pascal, OCaml, C, Java, Haskell, Common Lisp, JS, Clojure (listed roughly in chronological order of learning).


Memorizing syntax is pretty useless in the real world because you can just reference syntax using Google. It is much more important to know how to think (and in turn, code) than to know a language fluently. If you know PHP well, you can almost certainly code well in Python if you wanted to jump into a project, the same with MySQL and postgres, etc.


Once you understand the space of possible programming languages you can often learn a new one in just a week or two, I learnt Go over the last two weeks and it is so similar to C there wasn't much friction involved and I am already getting things done pretty comfortably. As always on such occasion I must recommend the book "Programming Language Pragmatics" for getting a good understanding of various possible language semantics.

What is harder and crucial for productivity is remembering a wide subset of the standard (at least) library, and this is much harder. I wrote non-trivial software in C, C++, Java, Python, Ruby and Lisp/Scheme, but I only really know by heart the standard library in Ruby, because I do it for a living currently, and a fair bit of the Java one, in other languages I have to look up things all the time.


> Once you understand the space of possible programming languages you can often learn a new one in just a week or two,

This is only true if that new one is closely related to the ones you already know.

Learning, say, Haskell, in the period of week for the person with knowledge of “standard set” like C,Python,JS,Go will be somewhat painful exercise include some brain explosions.


What I meant by the "space of possible languages" is the set of design choices involved in making a programming language, and this obviously includes deciding on the imperative, logical or functional (or yet another) paradigm. A good general programming languages book like the one I mentioned, or a general programming languages course at the university, will teach you things like dynamic vs. static typing, lazy vs. eager evaluation, different possible type systems etc. Once you learn those things in a general setting it is much easier to learn a new language, by identifying it as a point in this space (e.g. strongly typed, lazily evaluated, functional language with pattern matching ...), unless it's a total outlier from all the current major streams of thought.


Although having put a bunch of effort into Haskell, I encounterd golang and thought "Oh cool - C with typeclasses!".


The problem is it's not that simple though because interviewers like to ask really language specific questions for example a C interviewer favorite: what are the different uses of 'static' in C.


C is a pretty core language to know, that spawned several others.

It's a special case IMO.


Go is similar to C in the sense that for every decision C made, Go made the opposite.

Go: no headers. C: headers.

Go: no pointer math. C: pointer math.

Go: multiple return values. C: one return value.

Go: no parens for if/for. C: parens for if/for.

Go: interfaces. C: no interfaces.

etc.


For any two points in N-space, you can draw an (N-1)-sphere around them such that the line between them forms the sphere's diameter. Then they appear to be opposites, within the artificially-limited domain you're talking about.


I didn't claim those are identical, but you are cherry-picking facts, what about:

- syntax (curly braces, star for pointers and dereferencing, ampersand for getting the address etc., cleaned up for faster parsing and with some genuinely new things)

- iteration via for loops (no iterators, no map/fold/...)

- structs for data abstraction

- layout of variables in structs corresponding directly to memory layout

- argument passing by value or via pointers

- very weak typing

Look at it from the other side, what new things has a C programmer coming to Go learn, besides the syntax? Slices, goroutines, make/new, and some little bits related to packages/runtime, all hardly difficult concepts. Some old habits do not work anymore, mostly minor things. Finally both authors (Thompson and Pike) were C coders for decades...


I wouldn't call Go's typing "very weak". It's not Haskell, but it's still a fairly typical manifestly-typed language like C# or Java (minus contra- and/or covariance), and you certainly can't just slop values around without thinking about their type. "Very weak" I'd reserve for Perl, Javascript, or (I think) PHP, with their propensity to turn "anything" into a string or a number out from underneath you.

It is generally stronger than C's, in that C lets you be quite... creative... in how you cast values. Go qua Go does not let you do that, though it does have an escape hatch via the unsafe package that lets you do anything C can, mostly used for interfacing with C.


Go does indeed add some nice checks over C. For example, given:

    type foo int

    var (
	    A foo = iota
	    B
	    C
	    D
    )

    func bar(x foo) ...
It's an error to write:

   bar(2)
That's enough typing to prevent many types of annoying mistakes.


Yeah, the only gotcha I've ever had with Go was being confused about why I couldn't pass a pointer to an interface. Then I grokked what interfaces are in Go (a pointer to an implementation satisfies an interface, a pointer to an interface is nonsensical), and was good to go.


> Go: no parens for if/for. C: parens for if/for.

If the if/for constructs are sufficiently alike that you can meaningfully compare their parentheses usage, then I think that's evidence they're pretty damn similar.


Ha yes, I just looked at that and thought: How would I explain the difference in method calls in Obj-C and JS in 7 words. i.e. Something thats actually quite different...


I don't think multiple return values or interfaces were considered at the time when C was made.

Also, the cost and gain of various features (for example headers) was completely different then.


He seems to be comparing it to his wheelhouse: Ruby. Syntactically C & Go are very similar in comparison.


I counted language families, but the hardest was lumping in all the SQL and stored function/procedure languages together to count them as 1. My highly conservative total is 4, and it occurs to me that less is more, and I should consider cutting back to increase focus.

Thanks for the nominally thought-provoking question.


Like everyone else, I had trouble with the definition of "fluent". I said 1, because there's really only one language that I feel like I could immediately jump into writing with minimal recourse to reference material. But that seems like a bad definition, since I could very quickly increase that to 3 or 4 by just brushing up on a few languages I haven't been using much lately, and I could increase it pretty much indefinitely by spending a week or so with any given C-style language.

On the other hand, maybe that's not enough to truly count as fluent, in which case I plausibly am not fluent in any language.


Written in a lot of languages so far, in most of them with projects/systems of my own (as in not just adding fixes or functionality to an existing work). But probably not being able to produce (no google/manual peeking) a complex program with many of the ones im not currently programming. Should be more than 15 years that i touched anything on pascal or rexx and also a lot have lookalike structures where i could mix a particular syntax of one into another.


I might say 10. But that depends on your definitions of `command` and `programming language`. Some might count CSS or Shell script as languages ... and some might count `command` as being able to get in shape after 1week, others might disagree. Very subjective.


Please add option for "Erlang" -- because, gen_server.


What is your bar for programming language? :D


"Effortlessly"? snicker




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: