Poll: How many programming languages do you command fluently?
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?
47 comments
[ 2.4 ms ] story [ 103 ms ] threadBut I suppose I could write FORTRAN in any language given access to stackoverflow.
"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.
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. :)
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.
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.
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.
Also, the cost and gain of various features (for example headers) was completely different then.
- 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...
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.
It's a special case IMO.
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.
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.
Throw in some Haskell, Forth, Prolog and now you're getting interesting!
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.
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?
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.
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.
And this (not exactly non-trivial though): http://www.codeskulptor.org/#user14_OI6cFSxxCICXtA5_37.py
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.)
Thanks for the nominally thought-provoking question.
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.
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).