Hacker News new | past | comments | ask | show | jobs | submit login

This is dead on: "Whatever you choose to learn as your first language, the key is to learn from great code."

It's also worthwhile to learn a lot of other languages. Do it as soon as possible in your career, especially Lisp and C. No matter what language you may use, you'll probably benefit from knowing these two. The danger with any "first language" is that you may never learn a second.




Not always true. I learned Pascal, and then Ada first (in college). Haven't used since then, but I had no trouble learning C, Java, Lua, or Python later on. Lisp was slightly confusing, and I remember hating C++.

I think the key is learning well at least few kinds of languages. C (is a must), an object oriented language (Java), then a scripting language (Python, Lua, Ruby, Javascript, or Perl), then a pure functional language.

Of course, often in real life, often you end up using what is being dictated to you, but a good programmer should be aware of what's out there.


I think Lua is a particularly good language to learn early: it's quite small and very approachable for somebody vaguely familiar with the C languages, but it has coroutines, tall-call optimization, and quite a bit of flexibility via its meta-tables. I haven't used it on anything big enough to know if it's really practical for me as a getting-stuff-done language, but it's really growing on me.

Also, can of worms and all, but the borders between "an OO language" and "a scripting language" are quite thin. You could learn OO from Python or (I suspect) Ruby. OO design made quite a bit more sense to me when it didn't have to work around flaws in C, C++, and Java's type systems.


My favorite thing about Lua is the way you can fit all of the syntax in your head. I never have to go to a reference when writing everyday code in Lua.


Yes!


Why Lisp? Wouldn't any functional language do the same? I'm not flaming here, just wondering... I learned SML which was OK, but it didn't change my world. I still like writing code in Ruby better.


In short, no. ESR had it right. "That experience will make you a better programmer for the rest of your days, even if you never actually use LISP itself a lot."

My primary bread-and-butter language is Javascript. When done "right", Javascript is a very expressive functional/prototypal object oriented language with a lot of very interesting features. If you can do it in lisp, you can do it in Javascript: http://foohack.com/tests/ycomb.html

I've seen in myself and in coworkers, the best Javascripters know at least a little lisp, and as their lisp skills increase, so do their javascript skills. I suspect it would have the same effect on Ruby or SML or Erlang programmers.

Their attitude towards boilerplate code tends to change as well, and they begin seek solutions that are as concise and expressive as possible.

Lisp is unique because it effectively has no syntax. You write the abstract syntax tree directly. By removing the scaffolding, Lisp exposes the programmer to the fundamental nature of any programming language in a way that no other programming language does.

That's why C and Lisp are the best languages to learn, as early as possible: if you know these two pretty well, you're in a good position to master any language you might come across.

Misc is a promising cousin of Lisp: http://will.thimbleby.net/misc/ I've played with it a little, but not enough to really have a strong opinion of it.


There are some great books for Scheme in particular. Many of them are geared toward the art of programming itself, rather than how to do X in Y days, which frees up the curriculum for exploring things like recursive forms that a student in a hurry would almost certainly just hack around, without learning the fundamental idea.

Also, learning Scheme as a first language almost guarantees you'll have to learn a second language. ;)


I learned SML which was OK, but it didn't change my world.

This seems odd to me. Working with Haskell for a while changed how I think about state. I usually avoid (non-trivially) mutable objects now, and instead return a modified copy of an object. (For an example, see the process method here: http://git.jrock.us/?p=Template-Refine.git;a=blob;f=lib/Temp... )

Also, Haskell's type classes (and CL's CLOS) are a different approach to OO compared to Smalltalk-style "send a message to the object". It is definitely good to be able to think about OO both ways.


Just curious, have you used OCaml much? I'm really curious how it compares to SML.


Lisp isn't just a functional language. Yes, you can write functional code in Lisp, but you can use other techniques when functional is awkward.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: