
Important languages to learn to understand different approaches and concepts - fogus
http://stackoverflow.com/questions/3958630/what-are-important-languages-to-learn-to-understand-different-approaches-and-conc
======
larrik
I'm surprised no one mentioned actually learning C or C++ for the experience
in compiling/linking/makefiles/etc, as well as in vigorous memory management.
THAT is a skill he seems to be lacking, and it's a skill that mastering can
really help in the future. (Actually, I hope I'm wrong about that one :)

You program a bit differently when you have to wait minutes for it to compile
in between tests.

He said he's familiar with the syntax, but that's only one piece (and often
not the biggest piece).

[Edit: ouch, apparently I posted this with the last sentence unfinished! Also,
I don't think the posted answer suggesting C or C++ is really talking about
the same thing as I am.]

~~~
Ixiaus
I have to agree with you. Having started life using PHP, Python, Ruby, etc...
I had _no idea_ what memory management even was. I think learning the hard
fundamental languages like C and Assembly (HLA) are super important - C is
easily the most influential language of our time (I'll get slapped for this,
but do know that I actually don't like C, I would rather use D, but C is so
widely used and pretty much every important program has - at least - /some/ C
in it).

I also agree, knowing syntax is very different from working in the language at
a production level for five years. Syntax, idiom, paradigm, and culture are
all hugely important - some of those things are remarkably subtle for certain
languages and only get picked up after being slapped by the more experienced
programmers of that language!

------
russell
SQL should be in every programmer's bag of tricks. True, it's not Turing
complete, but what it does, it does well. I classify it as one of those mind
stretching languages. It forces you to think in sets, and complex queries have
very much an inside out flavor. From the practical point of view, a good
knowledge of SQL gives you a decided advantage over those who depend on an
ORM.

------
IgorPartola
I am surprised nobody recommended C. It's a very useful language and if you
ever want to design anything at all that scales, knowing C will help you a
lot, even if you don't use it. Definitely an mind-altering language.

Also, doing some simple circuit design might be fun. Simulators are available.

EDIT: Also forgot about to mention, but I find it odd that people still talk
about learning a syntax. The OP mentions how he is familiar with the
whitespace and C-like syntaxes as if that is the main point of the language.

~~~
rednum
Could you elaborate on connection between C and designing things that scale? I
don't get it and I think I may be missing something.

I support C too. While I don't use it everyday (actually I avoid using it) I
think it is important to do some low level and system programming - and C is
here important. Every programmer should code e.g. a simple binary tree from
scratch (with manual memory management) just to see what it is like.

Also as a matter of fact someone recommended C but it's buried down with 0
votes.

~~~
IgorPartola
There are a few things you can take away from having some C experience that I
think are related to building scalable systems:

* Managing your own memory. If you want to build a distributed system, being able to fit more instances of your program onto a single box is going to save you a lot of money/headaches. Removing unused objects from memory is a valid optimization in most languages.

* Avoiding dynamic memory allocations. In languages like Python all memory allocation is dynamic. However, unloading/loading the same object over and over is something I've seen a lot of.

* Understanding pointer arithmetic and pointer passing usually leads to better understanding of how other languages pass data around. This leads to avoiding doing lots of copying of data structures in memory.

* More of a systems programming thing, but understanding temporary file systems, RAM disks, OS file caching and when to implement your own caching system.

* Better understanding of low-level concurrency implementations and its limitations. Most scripting languages have little support for concurrency (PHP has none, Perl and Python are pretty limited).

* Understanding of the stack and how expensive it is to make even a trivial call vs inlining code.

* Better understanding of network protocols, when to use TCP/IP vs UNIX sockets, how to arrange for connection pooling, etc.

* A general mindset of minimalism when it comes to allocating resources.

~~~
cube13
>* Avoiding dynamic memory allocations. In languages like Python all memory
allocation is dynamic. However, unloading/loading the same object over and
over is something I've seen a lot of.

I don't think that C really teaches you to avoid dynamic allocation. In a lot
of situations, it's unavoidable, especially if the program needs more memory
allocated than the stack will allow.

What C teaches, as you said in the first point, is memory management. You
don't use mallocs without knowing exactly when the memory is free'd, don't
allocate new memory unless you actually need to, etc. C forces you to make
decisions about how you're using the memory, whether you can stack allocate
it, if it needs to be heap allocated, and when it needs to be destroyed.

------
Jun8
Many excellent answers given, but this comment, I think says it all:

"You seem to be a successful programmer, the rest is incremental. Not trying
to be a dick, but ... how is your life finance-wise, relationships-wise,
health-wise, fun-wise, hobby-wise? Perhaps now is the time to pursue some of
those things."

~~~
meterplech
I don't really think it's a good answer. To me that comment is the difference
between Quora, which aims to be an opinion-based Q&A, and
StackOverflow/StackExchange which aim for facts. I know his question was
opinion based, but is there a need for that comment. He could very well be a
happy and healthy family man who learns new languages as a hobby. And, anyway,
who cares? Just answer the question with your thoughts if you have them.

~~~
dionidium
It would be a terrible answer, but it's a fine comment.

~~~
mquander
I think it's an exceptionally rude comment. There's no way that the fellow is
going to find it helpful in any way, and it's seriously demeaning to offer the
unasked-for "advice" that their hobby is probably not worth pursuing further,
and maybe they should just go do something else instead. If you have to
preface your words with _"Not trying to be a dick, but..."_ perhaps you should
just leave them in your mouth.

I found the asker's response to be amazingly gracious. I would have been
rather rude in return.

------
Aissen
There's a book for that: [http://pragprog.com/titles/btlang/seven-languages-
in-seven-w...](http://pragprog.com/titles/btlang/seven-languages-in-seven-
weeks)

~~~
silentbicycle
I too was disappointed by that book. While conveying anything substantial
about a language in that little space is quite difficult, I was underwhelmed
by his overviews of Prolog, Haskell, and Erlang (each of which I have some
experience in), and suspect the other treatments are equally lacking. It also
annoyed me how he characterized the language in the first few pages ("Scala is
Frankenstein's monster!" or something like that) and then pushed the metaphor
for the rest of the section.

You may be better served by _Essentials of Programming Languages_
(<http://eopl3.com/>), _Concepts, Techniques, and Models of Computer
Programming_ (<http://www.info.ucl.ac.be/~pvr/book.html>), or _Programming
Languages: Application and Interpretation_
(<http://www.cs.brown.edu/~sk/Publications/Books/ProgLangs/>) - also knows as
EoPL, CTM, and PLAI, respectively.

It really helps to cover several styles of language with interpreters in one
common language, to avoid getting hung up on syntax and other surface details.
Anyone whose entire impression of Lisp / Python / Erlang / K consists of
bitching about parenthesis / significant whitespace / "ugly syntax" /
"unreadable noise" has cheated themselves.

------
lkozma
A similar question could be asked for human languages.

~~~
Jun8
Good point, since I think that some concepts from linguistics can be carried
over to computer languages and vice versa. The central dogma of Chomskyism (
which is ~ linguistics, at least in the US) was (roughly) that all languages
are equivalent, hence linguistic relativism was BS. This approach has been
shattered recently by quite a few people, I think one of the most well known
is Lera Boroditsky (<http://en.wikipedia.org/wiki/Lera_Boroditsky>). Luckily,
CS people (and the like) never had their minds warped by this paradigm so have
always been free to discuss "which language to expand the (programming) mind".

My rant done, let me produce my list:

* Ancient Greek (or Latin) - inflectional: Just sheer coolness of it and the literature you can read in the original is enough. But these languages are the grand daddies of Indo-European (unless you wanna go Hittite or Lithuanian) grammar and will teach you valuable linguistic and conceptual points (i.e. cases, noun declension). Learning this is like learning ALGOL, kind of useless but you'll see where a lot of concepts have originated from.

* Mandarin (i.e. Chinese) - isolating: Two points: Seeing the syntaxlessness of these languages is mind boggling and expanding experience. Many poet/translators have remarked about the "timelessness" of Chinese poetry, because verbs don't have tense markings. And, of course, the writing system is very interesting, too. Like learning Lisp (Scheme), an interesting, expanding experience.

* Turkish - agglutinative: (Disclaimer, I'm a native speaker) A great into to the agglutinative aspect of languages (unless you want to learn an American-Indian language) and an interesting phonetic system, so regular, is used as an example a lot in phonology courses.

* Swahili: The concept of noun classes (a generalization of grammatical gender) is bewildering when you first encounter it, swahili has 16 of them (<http://en.wikipedia.org/wiki/Swahili_language#Noun_classes>)

And more esoteric ones that would be great to learn: My favorites would be
Basque (interesting language isolate) and Georgian.

~~~
pfedor
The existence of the phenomenon of translation proves that all natural
languages have the same expressive power. You can translate a text from any
language to any other language without losing its meaning, and the translation
won't be 10x the size of the original. Typically there will be a close to 1-1
correspondence between the sentences and paragraphs in the original and the
translation. None of which is true for programming languages, since
programming languages actually do differ in significant ways.

~~~
jokermatt999
Actually, there are generally words that don't quite translate well. It's
generally subtle connotations, so you can get the general meaning of a
sentence, but not some of the undertones as easily. Since you won't get a
compiler error if you miss some of the subtle differences in a translation and
you'd need to be familiar with both languages in question, it's harder to pick
up such differences.

For some examples of what I mean by concepts that are sometimes difficult to
translate, look at most examples on this blog: www.betterthanenglish.com/

The older examples are generally better, and I don't agree with the phrase
"untranslatable word", but it should provide some general idea of the kinds of
ambiguities that would be lost in translation.

~~~
vorg
> Since you won't get a compiler error if you miss some of the subtle
> differences in a translation and you'd need to be familiar with both
> languages in question, it's harder to pick up such differences.

You might get a scowl, or some other non-verbal feedback, during speech.

------
dodo53
Some people think that your usual language affects how you can thnik
(<http://en.wikipedia.org/wiki/Sapir%E2%80%93Whorf_hypothesis>; not sure if
I'd agree that strongly) - so possibly you wouldn't be able to miss
expressiveness you're not familiar with (simlar to pg's idea of Blub
programming language).

Wish I knew more about linguistics - but I think missing tenses or grammatic
logical structures are more interesting than missing vocab - like for example
some languages have a tense for describing things you only know about second-
hand <http://en.wikipedia.org/wiki/Inferential_mood>

(missed the bit I was meant to be replying to sorry...)

~~~
pchristensen
I think it's more about the relative ease or difficulty of expressing a
concept in that language. If a concept is missing or unnatural, it's going to
be harder to deal with that concept. Common examples of languages with more
expressiveness than English are the multiple Russian words for blue, or the
many Eskimo words for ice.

A thought experiment that I think works better is to imagine a language where
people describe facial features extensively, to where a description in that
language can easily be used to reconstruct an image of a person's face.
Imagine how crippled a native speaker of that language would feel trying to
speak in English, or the derision they would have towards the police sketch-
artist process that took trained artists/interpreters quite a bit of time to
extract a description from a witness that would sound like a 4 year old trying
to describe a face. That's what linguistic differences are more like.

------
adestefan
My problem is trying to come up with ideas to use as practice. I could always
do the same old thing over and over, but I'd rather find something that
highlights the strength of a language.

~~~
dkersten
I like the book Programming Challenges[1] for this.

[1] <http://www.programming-challenges.com/pg.php?page=index>

~~~
lt
Nice! Actual problem list:

[http://uva.onlinejudge.org/index.php?option=com_onlinejudge&...](http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8)

(not sure if they are the ones from the book, but they are linked from there)

~~~
dkersten
Oh good find. Yes, the ones in the Programming Challenges subdirectory are the
exercises from the book.

------
norswap
As a multi-paradigm language, Oz is really interesting because it has all
these approach into a single language, you can easily compare and see the
strength of each approach. But you can even go further and see how the
different approach can interact.

<http://www.mozart-oz.org/>

------
yread
I would add PROMELA-SPIN a non-deterministic language for modeling and
verification of systems. Plus other formal verification languages:Z or Petri
nets

Also SQL! (although he probably knows it already...)

~~~
fogus

        Also SQL! (although he probably 
        knows it already...)
    

That was my line of thinking in my reply. That's why I instead chose Datalog
as the declarative choice. Much of what you can do in SQL can be done with
Datalog (and vice-versa), but there are somethings that Datalog can do that
SQL cannot.

