Ask HN: What language should I learn next?
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
[+] [-] danpalmer|12 years ago|reply
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
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
[+] [-] taprun|12 years ago|reply
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
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
[+] [-] pjmlp|12 years ago|reply
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
[+] [-] maratd|12 years ago|reply
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
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
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
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
[+] [-] facorreia|12 years ago|reply
[+] [-] mattkrea|12 years ago|reply
[+] [-] lsiebert|12 years ago|reply
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
[+] [-] gamegoblin|12 years ago|reply
[+] [-] 0x006A|12 years ago|reply
[+] [-] sssilver|12 years ago|reply
[+] [-] dethtron5000|12 years ago|reply
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
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
[+] [-] greenyoda|12 years ago|reply
[+] [-] mattkrea|12 years ago|reply
[+] [-] planckscnst|12 years ago|reply
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:
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
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
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.
[+] [-] Ideka|12 years ago|reply
[0]: http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-4.html
[+] [-] unknown|12 years ago|reply
[deleted]
[+] [-] leftrightupdown|12 years ago|reply
[+] [-] csense|12 years ago|reply
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:
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
[+] [-] mattgreenrocks|12 years ago|reply