top | item 7538695

Ask HN: What language should I learn next?

20 points| mattkrea | 12 years ago | reply

So I've spent significant time in Node, Go, VB, and C#. I've got an "understanding" of Objective-C also.

I've toyed around with C and love it but haven't been able to think of a tool for myself to build as a project and that's really how I actually learn a language.

I have no interest in Cpp but other than that I'm very interested and open minded.

I used to hate Ruby and Python syntax but I am warming up to Python after experimenting some more. Ruby not so much ( what is it with the pipes when you iterate over something ) but I could be convinced.

All in all I'm open to suggestions and with a fairly diverse group here I imagine I could find some direction or at least some pointers ( no pun intended ).

Thanks everyone

52 comments

order
[+] danpalmer|12 years ago|reply
Haskell.

I notice there's nothing functional on your list. Any functional programming should prove really interesting for you, and teach you a lot. Certainly learning a bit of Haskell has changed how I write in all other languages. I would go for Haskell because the strict type system is also a really interesting thing to learn, but alternatively you could go for Erlang which emphasises error handling/recovery for services with high uptime, or something like Scheme which has s-expressions and macros which are apparently really great to learn.

[+] mattkrea|12 years ago|reply
Thanks for the additional details on these.

I experimented only very little with Erlang when I was setting up an XMPP server but the syntax was so confusing. I could get over it eventually as I imagine everyone faces that.

[+] mck-|12 years ago|reply
If you haven't read SICP yet, I can highly recommend it. It is taught in Scheme (dialect of Lisp); you'll be reading one of the greatest programming books of all time while you're at it -- it certainly opened up a whole new paradigm of coding for me (and I still use Lisp in production today, along side Node.js)
[+] taprun|12 years ago|reply
I'd suggest trying to think about what types of things you want to build in the future and then picking a language that is used to build those types of things.

I can shout "learn assembler" until the cows go home, but if you want to go into AI and hate the idea of being an embedded programmer, then you'd be much better off learning LISP.

When I was a bit younger, everyone told me to learn PERL, because PERL was very powerful. I learned it, but never really needed it, because I never needed to write software that was heavy on text processing or system administration. If I were able to do it all over again, I would have picked R instead, because it would have been much more useful for my career path.

[+] mattkrea|12 years ago|reply
Well after reading your comment I thought a bit and I think maybe half of what I'm looking for is a change from the types of things I build now. I'm essentially all web at the moment. APIs, TCP & UDP, aqp, etc.

I would love to do desktop apps on Linux but it seems that my only real choice there is C++ and that has always seemed a language beyond what I could do.

[+] dapz|12 years ago|reply
Modern AI (Machine Learning) doesn't have anything to do with Lisp.
[+] pjmlp|12 years ago|reply
All the languages on your list are basically the same in terms of supported concepts, imperative and OO, with a little bit of functional.

If you are learning just for fun I would suggest a bit of Prolog for logical programming, a Smalltalk derivative to see how the original OO is all about and the Xerox Parc concepts or a more pure FP language like F#, OCaml, Scala, Lisp derivative.

If on the other hand you intend to learn more with focus on a certain career path, then better look into what languages are being used in the fields you care about and learn one of those which you still don't know.

[+] jaegerpicker|12 years ago|reply
I think a purely functional language would teach you quite a lot, it certainly did me. F# runs on the .net run time and you should be able to easily find/figure out the .net libs since you have used C# and VB a good bit. Clojure and ClojureScript are really great options. Clojure is a lisp that runs on the jvm, plenty of great web frameworks to work with and a metric ton of libs available to the jvm. Clojure Script is Clojure targeting a JavaScript runtime, it works great with node.
[+] maratd|12 years ago|reply
> What language should I learn next?

You should definitely learn PHP.

That way you can partake in all the wonderful flame wars that pop every few weeks here.

[+] adamors|12 years ago|reply
> That way you can partake in all the wonderful flame wars that pop every few weeks here.

You're being silly. To be best equipped for a PHP bashing one shouldn't know PHP or anything related to PHP.

[+] kephra|12 years ago|reply
> I used to hate

thats good. There are 10 kind of languages: Those nobody use, and those everybody hate. So a coder who does not curse a language has never used it.

Now the question what to learn next is depending if you want to learn languages that open your mind for new concepts, or do you want to learn a language that helps you in the job market?

For the first I would recommend:

Forth or Postscript to learn a stack oriented language.

Lisp or Scheme to learn a lambda calculus language.

Smalltalk to learn what real object orientation means.

Lua or Javascript to learn prototyping.

Haskell to learn functional programming.

Erlang to learn how to write massive parallel code.

Last improve your C skills, read "a little Smalltalk", and write your own programming language. Dont be shy. Ruby or Python code reads as if they also did read a little Smalltalk, decided that designing their own language is easy, and repeated all errors from the book. Always remember: Smalltalk was 35 years ahead of its time. Since then every year a new language is hyped, each of them one small step closer to Smalltalk.

If you want to learn for the job market, then learn Linux, Perl, PHP, Java, SQL, HTML, CSS and JavaScript.

[+] metaobject|12 years ago|reply
What errors did python make wrt to design that were first found in smalltalk?

I remember reading somewhere that the OO system for python was sort of bolted on after the language had been around for awhile. When I write classes in python, there is something awkward about it that I just can't put finger on. I remember thinking it was strange to have to pass in 'self' to member functions, and then realizing that it was like 'this' in c++. So why does c++ hide that implementation detail while python lets that detail leak out? I wonder if 'self' could be passed in behind the scenes and any references to local variables that haven't been declared in that scope can be assumed to be instance variables.

[+] trhtrhth|12 years ago|reply
What about OCaml or SML/NJ? :(
[+] facorreia|12 years ago|reply
Java is a very important language that's missing from your list. You should probably spend some time learning a bit about it. And Scala could be a language you'd decide to stick with to build some serious stuff.
[+] mattkrea|12 years ago|reply
I've actually been looking into it somewhat. I just grabbed Eclipse but though I might gather some opinions before I start investing serious time.
[+] lsiebert|12 years ago|reply
I'm going to suggest that you don't learn a new language, but that you learn how to deal with broader issues and to think about problems.

Go deeper, not broader. Another language can help you learn about stuff, but knowing languages is less important than understanding how they are used.

Learn about event handling. If you have toyed around with C, get an arduino and learn about hardware interrupts. Learn about concurrency and distributed systems. learn about semaphors and locks and other ways to deal with resource contention.

Understand memory. Know how a hash/dictionary works. Look at implementations of variable length arrays.

Write a toy database and driver. Now make it work when two programs are accessing it at the same time.

Write a server.

Take old horrible code in some language you know well, and update it to current standards with unit tests.

Read the code libraries you use often. Or try to implement your own version of the base case of a POSIX like tail.

Write a function to convert a string to a floating point number without taking advantage of the built in float or atof functions.

Learn about how compression algorithms work and implement a simple one.

These are not easy things. And you don't have to finish them or do well or do all of them. But you will get experience you can't get sticking with the basic features of a language that will serve you well.

[+] kotakota|12 years ago|reply
I think this is the best advice. A lot of these projects will force you to learn new concepts, algorithms, and they will give you a new way of thinking about problems. Learning a new language won't necessarily do any of those things.
[+] gamegoblin|12 years ago|reply
Highly agree. I've got my main languages fleshed out (Python, C(++), Java, and Haskell), and have found it incredibly rewarding to implement web servers, regex engines, databases, interpreters, etc.
[+] 0x006A|12 years ago|reply
If you want to experiment, Rust might be something for you.
[+] sssilver|12 years ago|reply
Rust is definitely most worth learning. Everything else will then be pretty much a subset (perhaps with the vague exception of C++).
[+] dethtron5000|12 years ago|reply
If you want a structured, high-level intro to several languages, Bruce Tate's "Seven Languages in Seven Weeks" is pretty good. (http://pragprog.com/book/btlang/seven-languages-in-seven-wee...)

I'd recommend Erlang for its concurrency model (especially comparing how languages like Erlang, Scala, Go and JavaScript/Node handle concurrency and parallelism differently).

Haskell is good for functional concepts - understanding FP will help with functional stuff that is migrating into more mainstream languages.

Learning a Lisp (Common Lisp or Clojure) is good too.

Python is great for the mature community that's developed around scientific projects like machine learning, NLP and such.

[+] ludicast|12 years ago|reply
JVM knowledge.

I would encourage you to learn some Java (helps with understanding the ecosystem, and used in plenty of examples), and then focus on a JVM language. Scala and Clojure are obvious choices, because they come with their own ecosystems and contain new language paradigms.

[+] ninjakeyboard|12 years ago|reply
Scala or Haskell would be my vote. You already have enough imperative stuff up on your learning wall there - learning more languages won't really teach you how to think differently unless they are able to produce sufficiently different ways of describing problems and their solutions. You could probably learn ruby in a day but would it make you better for doing it? Probably not so much. But learning functional programming WILL make you better - you'll be able to take the approaches and write better code in imperative languages because you'll understand how to reduce mutability and write more declarative code using lambdas in the other languages you mention.
[+] greenyoda|12 years ago|reply
You might also consider learning something other than a new language. Learning more about operating systems, fundamental computer science stuff or even project management might make you a better developer than learning yet another programming language.
[+] mattkrea|12 years ago|reply
My career is actually in PM but good point.
[+] planckscnst|12 years ago|reply
About the strange Ruby pipes when iterating thing...

Ruby, like many languages, has support for anonymous functions (lambdas, procs, blocks, etc.) The pipes are the delimiters for the formal parameters that the function receives. Most languages use parentheses for that. For instance, you might expect something that looks like this:

  function_that_accepts_a_lambda(arg1, arg2, lambda(lambda_arg1, lambda_arg2) { lambda body; })

Here, a function body is defined and passed as an argument in the same place other arguments are listed. Also, the parameters of that function are defined outside the body of the function, within parentheses.

In Ruby, the format is just different. You can bind a lambda to a variable and pass that variable in just like any other argument, but if you want to give an actual unbound function body as an argument, you have to use the Ruby block syntax, which delimits the block using either `do`...`end` or `{`...`}`, and immediately after the beginning delimiter, you can define formal parameters. The definition of the formal parameters of the block is delimited by pipe `|` characters. The other strange part is that the block is not presented as an argument quite the same as the others: it is outside the list of formal parameters for the function receiving the block. The previous example in Ruby is

  function_that_accepts_a_lambda(arg1, arg2) { |lambda_arg1, lambda_arg2| lambda body }
The name of the function now is slightly misleading since in Ruby, every function can receive a block (although it may not do anything with it).

I can assure you that after working with the language for a while, that syntax is not a problem at all. I had, in fact, completely forgotten that I thought it was strange when I first learned Ruby. There are things much more annoying in Ruby than that syntax, like an abundance of slightly different ways to define a closure, each with subtly different effects.[1] Overall, however, it is quite a nice language to work with.

[1] http://innig.net/software/ruby/closures-in-rubyhttp://innig....

[+] mattkrea|12 years ago|reply
Wow.

Thank you very much for that. It is somewhat of a jarring change from what I'm use to but I at least understand it now.

[+] leftrightupdown|12 years ago|reply
If you want to learn how to get more performance out of your event/thread driven code, go with golang, it has improved how i write my code in python. I think more and more people are going to use golang in the long run. If you want to learn something different go with haskell.
[+] csense|12 years ago|reply
Ruby and Python syntax are quite different. Ruby syntax seems designed to be difficult to learn. It uses obtuse, non-standard, irregular syntax for common operations, requiring constant consultation of the manual for the beginner to see any non-trivial program as anything other than line noise. For reasons I do not really understand, Ruby is quite popular with HN users and I may actually receive downvotes for what I've said so far.

Python's syntax, by contrast, is simple, intuitive, and fairly standard. Python does have a few innovations over other languages -- the most important that come to mind are indentation-delimited blocks [1], tuple unpacking, list comprehensions, generators, args/kwargs, and access operator overloading. All of these are usually optional in your own code and easy to grok when you seem in others' code. When you are ready to use these syntax elements, you will find them easy to learn and quite practical in a variety of situations.

Python code can be concise without being unreadable. This greatly improves developer productivity, which is very important. Most projects are bottlenecked by developer time.

Python is a truly general purpose programming language, with excellent library support. People can and do use it for command-line utilities, web applications [2], math/science [3], and desktop applications [4].

[1] Using indentation to delimit blocks is a controversial "innovation" of Python. I suggest suspending judgment until you've written at least one medium-sized program in Python. As a matter of coding style, usually programs written in high-level languages also use indentation to denote blocks; when this indentation gets out of sync with the rules the language actually uses to delimit blocks, you can get hard-to-spot bugs like this one:

    if (myflag);
        myFunction();
This will compile, but the if statement is a no-op, and myFunction() will always be called, which is probably not what the author intended. The above bug cannot happen in Python; since Python actually uses indentation to determine blocks, by definition the indentation cannot get out of sync with the way the compiler/interpreter sees your code.

[2] For Python webapp development, I recommend writing a simple webapp with Flask first, then adding sqlalchemy for proper database support. Once you're comfortable with that combination, you'll want to switch to Django.

[3] Try Sage, IPython, numpy, and scipy.

[4] I recommend GTK+ for desktop apps, especially on Linux. http://python-gtk-3-tutorial.readthedocs.org/

[+] mattkrea|12 years ago|reply
I spent some time with Python just this morning and was curious. Starting out.. should I use Python 3 or 2.x because most packages / modules are written for 2?
[+] mattgreenrocks|12 years ago|reply
Spending some time in Ruby is really good to really grok the metaprogramming and DSL capabilities of the langauge. These are generalizable elsewhere.