views:

859

answers:

15

I love learning new languages, but with limited time I want to optimize the bang I get for my buck.

So; which languages do you recommend learning to get yourself exposed to a new way of thinking about programming?

My own thoughts are

  • C, because it gives you a good understanding of low-level stuff.
  • Assembler, because it gives you good understanding of really low-level stuff
  • Haskell, to learn about pure(!) functional programming and lazyness (and to spoil yourself with type inference)
  • Smalltalk. I assume that it will teach you a new way to think about OO.
  • Lisp/scheme, because Eric Raymond and Paul Graham said so ;-) I assume this is for the macros---surely it's not just for the functional programming?

I think python and /bin/sh are great languages, and they are worth studying if you want to look at examples of languages that are very convenient. But, I find, they don't make you think in new ways. They're not radically different enough (to fit the bill of this question, at least).

If you answer, be sure to tell us all why you think the language(s) you list will help the student think in new ways :-)

+2  A: 

Eiffel to see multiple inheritance make sense.

you can edit your original answer to add more examples, such answer is more likely to get upvoted
SilentGhost
+2  A: 

Ada to see multi tasking/processing built into the language.

A: 

Occam to see CSP in action.

+14  A: 

The one that's most unlike the ones you already know.

Haskell, ML, OCaML, F#, or Scala for functional concepts. (The first is most hard-core functional, the next three are not quite so strict, and Scala is a hybrid OO/FP langage which may provide an easier "glide path".)

Prolog or SQL for declarative programming. (Again, the first is hard-core, the second -- depending on implementation -- may contain lots of procedural/imperative extensions.)

Smalltalk, Squeak, Python, Ruby, or Java for OO. (First two hard-core, the other three mix OO with procedural.)

Erlang or Occam for parallel programming. (The first is easier to find.)

joel.neely
I should point out that F# is a (fully) FP/OO hybrid too.
Noldorin
***The one that's most unlike the ones you already know.***That's probably the key point right there.
Jonas Kölker
Isn't Erlang a functional programming language?
Jonathan
Would not Scala be as suitable for parallel programming as Erlang?
Fabian Steeg
A: 

SETL, to see how powerful value (vs. pointer) semantics can be (more so than PHP4 or even Haskell.)

finnw
+2  A: 

forth to truly learn decomposition and reverse polish notation

+1  A: 

Javascript / Ajax. Makes you rethink your internet applications. Try JQuery

Kb
+5  A: 

C++. If for no other reason that HAVING to deal with pointers.

bxlewi1
Also to understand how C# elegantly solves problems which can crop up because of the incorrect usage of C++
Naveen
Wouldn't C be just as fine? C++ offers you "pointers-in-a-box" too much (in the form of vector, list, set, auto_ptr, etc.)
Jonas Kölker
I love working with programmers who have done large projects in C. If they can do it in C, they can do it in Java or C#.
Nosredna
I agree that C is better than C++ when it comes to learning pointers.
Chris Lutz
I also had the immediate question, "Isn't C better for pointers than C++?" C++ is too messy a hybrid language, half-OO and half procedural. Better, just for pointers, would be plain old ANSI C.
Eddie
+6  A: 

I'm surprised to see no one has mentioned Perl yet. It thought me a lot of things, among which the most useful is regular expressions. Of course, you could say that regular expressions is a special language by itself regardless of the programming language that deals with them. But Perl uses regular expressions most heavily (IMHO) among all languages that supports them.

PolyThinker
A: 

Add Prolog or some other logic programming language (Mercury, Curry) to your proposed languages and you got all the major programming language paradigms covered.

starblue
+2  A: 

Crazy-ass JavaScript for closures, currying, partial evaluation, functional programming, chaining, prototype-based inheritance, everything-is-an-object in a C-like package.

Forth for thinking in stacks.

Brainfuck for state machine, Turing machine computer guts.

Perl for thinking in Regular Expressions.

Laszlo and Flex for declarative XML programming.


Haskell and F# are on my "to learn" next.

I'm assuming most people start with Java nowadays, so anything that's not OOP is a good way to learn some new things.

Overall, JavaScript is perhaps the hippest and most enlightening of the mainstream languages, but you won't learn anything if you treat it like it's C.

Nosredna
A: 

Python also is a good language to tech discipline in programming, given its use of indentation. You have no choice but to be organized as you code!

Conrad
+2  A: 

LISP, be it Common Lisp, Scheme or Clojure. It's not just macros - it's the lack of syntax and fact that code and data have exactly the same structure. Once you grasp that concept you will see what Graham and Raymond are talking about.

Technical Bard
+1  A: 

If you don't know it, C/C++ will teach you a lot about the machine underneath. Everything you learn in C is valid in all the higher level languages.

I learned a lot from SmallTalk. Being a message-passing system, it does OO in a way that is very different from function call languages like C++ or Java.

Steve Rowe
+1  A: 

Lisp really helped me understand that loop and recursion is really the same thing. C++ teaches you to be very very detail oriented - as it's very low level and relies heavily on the programmer's competence.

gnomixa