What programming languages should I learn and why? - mhidalgo
======
bootload
_'what programming languages should I learn?'_

I'd rephrase the question slightly and ask, _'what problems should I work
on?'_ and _'how can the language(s) I use solve them'_. This is one reason why
lisp is a compelling choice. You can create your own sub-languages to solve
any particular problem.

But for lots of reasons lisp may not be suitable. There are lots of other
languages to choose so pick the ones that suit solving different problems.
There is not one _"universal programming hammer"_ (though lisp is pretty
close) but an array to choose from that may suit different types of problems.

esr in his faqto (faq + howto) recommends python, c/cpp, java, perl and lisp.
Each language chosen for their abilities to solve different types of problems
~ <http://www.catb.org/~esr/faqs/hacker-howto.html#skills1>

Tall order? Take too long? Then read on with Norvig and _'Teach yourself
programming in 10 years'_ ~ <http://www.norvig.com/21-days.html>

------
dazzawazza
+1 for python. Why? excellent docs, excellent libraries, excellent books,
flexible language thats easy to learn.

~~~
timg
Agreed.

But, shouldn't _we_ be asking the poster "why"? If the "why" is because he
wants to be good at programming, then I would suggest that he first does some
light c, a tiny bit of assembly, and a get a basic understanding of FP
languages and the insanity of advanced OO in java.

In the end though, be sure you are using Python. Heck, even if you get bored
along the way, throw some python in.

A [Warning] though: python will spoil you. Good luck going back to a more
verbose, rigid language, should you be forced to.

~~~
jamongkad
Same thing can be said for Ruby and Perl

------
ced
While we're on the topic, PG mentions in one of his essays a few languages
with a "reputation for succintness": Forth, Joy, Icon. They are all tiny blips
on my radar, popping up once every year in some obscure article. Does anybody
have experience with them, and are they worth learning? (Forth is already
covered on this page)

~~~
benhoyt
I learnt to program by writing a Forth compiler in assembler (Dad taught me).
It was a superb way to learn.

One of Forth's strengths is its ultra-simple syntax. If you thought Lisp had
little syntax, think again. Forth is just tokens and whitespace. You can write
a compiler than can compile itself in a few screenfuls of Forth (and I'm not
talking about eval).

Forth is obscure but beautiful. It's reflective, meaning you can write code
that writes code (macros). Also like Lisp, you can easily roll your own
control structures or add an OOP interface. But it does lack good libraries
and a decent-sized user base.

~~~
jaggederest
I have just started poking with forth, after seeing some network card firmware
source written in it.

One of the most interesting things, to me, was the built-in disassembler: if
you ask 'how is this word defined', and it's not defined in the current
environment, it'll go disassemble the binary and show you that.

Pretty insane, if you think about having to write software to interface with
old / undocumented / closed source libraries.

------
mhidalgo
I have been teaching myself how to hack. I see that the first real software
engineering classes in most schools is taught in JAVA, usually a data
structures class. Should I even bother.... I see the merit of learning ground
level stuff , like memory management seen in C/C++ but with JAVA is it useful
to learn even if majority of web development is done in LAMP ( I should say
majority of web development interesting to me, I know there is alot of JAVA
out there) Does anyone know of a good book/tutorial to learn data structures
with languages such php/ruby/python.

~~~
rms
Lisp is great but Python/Ruby are a great halfway point between C and Java and
the purely functional Lisp type languages. It's tough to say whether you're
better off learning Ruby or Lisp first. It would probably make a good PhD
project for someone to compare the teaching of programming to first-time
students with Pascal, Java, Ruby, and Lisp.

Anyways, www.hacketyhack.com is a great integrated IDE for learning the syntax
of ruby.

~~~
gibsonf1
_"purely functional Lisp type languages"_ I think Common Lisp actually has one
of the most powerful Object Systems: CLOS

~~~
rms
Sorry, I meant languages that actually allow for functional programming, not
languages that are exclusively that way.

~~~
euccastro
Just to nitpick, any language that allows functions 'allows' functional
programming to some extent. More seriously, any language with higher order
functions, lexical scoping, and closures can be considered appropriate for
functional programming.

You probably meant languages that are biased primarily towards functional
programming, as opposed to others where FP is not the dominant paradigm. You
have to specify that much if you are going to include the Lisps but leave
Python out.

------
tim_sw
Read COncepts, Techniques, and models of computer programming.

You will get a taste of all these languages/paradigms, and in addition, others
like concurrent programming etc.

<http://www.amazon.com/Concepts-Techniques-Models-Computer-
Programming/dp/0262220695>

------
ivan
Learn ruby and/or python and C for low levels and/or create extensions for
those two.

------
jaggederest
lisp, haskell, prolog, forth, erlang, smalltalk, python, ruby, c, java

I think lisp will be adequately enunciated, so I'll move on to the others

Haskell is a lazy, strongly-typed functional language. It's syntax is very
close to mathematical notation, and it enables code reuse by not allowing side
effects. It'll teach you to think in actual algorithms, where most languages
teach you to think about how to implement those algorithms.

Prolog is a logic language. It'll teach you logic, and some of the fundamental
ideas from that field. Backtracking search, unification, and other interesting
ideas.

Forth is a reverse-polish-notation stack language that is very 'close to the
metal' and yet a higher order language than C. Forth will teach you more about
the workings of a computer than anything but assembler, and it won't break
your soul like assembler might.

Erlang is strict strongly-typed functional language that is all about
concurrency. Right now it's probably the best language to write highly
concurrent applications in, and, as it turns out, most of the internet can be
made highly concurrent.

Smalltalk is the mother of all object oriented languages, and shares with lisp
the interesting concept of a running image. In smalltalk, everything you do is
in a live instance of an image, and to deploy, you simply move the instance
over and run it on the server. This also one of the first languages to have an
effective refactoring browser.

Python is a dynamic object-oriented language that incorporates features from a
lot of previous languages. It's got some interesting things and a fairly nice
syntax. Take a look at TurboGears, Pylon, and Django

Ruby is a dynamic object-oriented language (lisp + perl) that is (like lisp)
all about metaprogramming. Ruby has also got an interesting framework that is
becoming notorious, Rails, which makes OR mapping and quite a few other things
brain-dead easy. If you get into the internals of rails, you'll learn a lot
about metaprogramming.

C is The Language. If it has to be fast, small, and close to the metal, C is
the go to language (no pun intended) There are a lot of situations where
you'll end up needing to rewrite in C if you hit performance problems, so
knowing some C will let you squeeze about an order of magnitude of performance
out of things. Plus, you can start to understand drivers for your hardware
here.

Java is less about the language and more about the IDEs. With the possible
exception of Smalltalk, Java has the best IDEs and refactoring software. This
is the kind of thing that most languages should have, but don't.

Anyway, this is kind of just a menu, but if you learn three or four of these,
you'll be well on your way to deciding which one suits your style.

~~~
Tichy
Sorry, but I think that is complete bullshit. Why should some beginner start
with Lisp and Haskell? He should start with something that is useful for him,
that is, he should consider what he wants to do, pick a suitable programming
language and get started.

Nothing against LISP, but if he was into Web programming for instance, I think
it would be a bad choice. Maybe an experienced programmer could leverage the
power of LISP for that task, but a beginner needs good documentation, examples
to look at, a community to ask when he is stuck etc. I don't think LISP would
be top of the list in those categories.

~~~
cwilbur
The value of learning all those different languages is not that they're
immediately and obviously useful. The value is that each one has a different
set of tradeoffs and assumptions, and being fluent in all of them will teach
you how to think more flexibly.

Sure, a beginner should use a language where he gets feedback and support. But
a beginner who aspires to be a real programmer rather than a 9 to 5 coder will
need a much broader base of experience than he can get by only working in one
or two languages, and understanding that sooner rather than later is key.

------
mynameishere
Now, you're going to hear a lot about how wonderful LISP (etc, etc) is, but
remember that almost every _real_ application is in C (Unix), C++ (games,
other desktop apps), or Java (50 million goddawful enterprise backends).

~~~
BrandonM
That might be true of "almost every _real_" desktop application, although on
my Linux install, I have a healthy amount of Python and Perl programs. As for
quickly prototyped web applications, I think that Lisp, Python, Perl, and Ruby
far outnumber Java and C/C++ (with Java far outnumbering C/C++).

------
gregwebs
Instead of learning C or C++ you may consider D which will enable you to learn
more about actual programming and less about the idiosyncrasies of C/C++.

~~~
dfranke
I agree that D is a better and cleaner language than C++, but in what way is C
idiosyncratic?

~~~
gregwebs
True, C does not suffer too much from idiosyncrasies, more from being poorly
designed in comparison to modern programming languages.

~~~
dfranke
On the contrary, C is _excellently_ designed for its intended purpose: as a
language for writing UNIX. If that's what you're doing, C is the ideal choice.
If you're using it for something else, you're misusing it.

~~~
euccastro
What do you use to optimize a bottleneck in Ruby or Python? (After you have
profiled, exhausted the higher level optimizations, and all that.)

~~~
dfranke
Well, most languages use C for their FFI so you're almost stuck with that. You
can still use D, since it can call C functions transparently. Though, if I
were designing a high-level language and wanted it to be able to call a fast
lower-level one, I might choose Forth or OCaml. Once it matures a bit, I might
change my answer to Fortress.

------
mhidalgo
I think this question really shows what a great community this site has
developed into. Thanks for all the help!!!

------
knome
All of them. Because we are compelled.

------
eli
as many as you possibly can.

so that you'll be able to pick the right tool for the job (nobody ever asks,
"which should I learn,the hammer or the screwdriver?")

~~~
euccastro
Yet time is limited, and there are other things a programmer should learn
besides programming languages.

------
fraXis
C#.

~~~
BrandonM
Especially if you want to do any non-Windows programming.

