From: mental@... Date: 2005-11-29T11:38:02+09:00 Subject: Re: Programming Newbie: Ruby or Java? Quoting James Britt : > > one of the languages that they use in academia to teach > > programming is lisp. you might want to take a look at that too. > > but just to learn because doing something real in lisp is > > painful. > > Is this true for people who learn Lisp as their first language? They adapt to the pain -- it's mainly just syntactic. The thing about Lisp is that the syntax isn't very humane, but you can certainly get used to it (macros are a powerful incentive to come to grips with it once you discover their utility). But that Lisp is actually "hard" is a myth, due mainly to the way in which the language is usually taught. Syntax aside, the language is plenty familiar. There's nothing magical about it. It's just that most Lisp courses are taught on something of a "throw the kid in the deep end of the lake and he'll learn to swim real quick" principle. People get jittery about things like first-class functions because they're presented as so strange and mystical, but really they aren't. What are Ruby blocks, after all? They're just syntactic sugar for lambdas. Ruby is a sly little victory for functional programming, actually. I mean, what if you told someone that a language had no for loops, and that instead you had to get by by passing functions to iterator primitives? "How can I do anything useful without for loops?!" they would say. That's a common objection to Scheme, actually (never mind that Scheme actually does have 'do', which is the same thing). At that point many Scheme advocates start talking about recursion, and people's heads explode. But then Ruby showed people it was okay. We don't normally use recursion, but then again neither does well-written Scheme code for the most part. In functional languages when you need recursion you usually want to reserve it for implementing little combinators (of which 'map', 'loop' and 'each' are simple examples) and then build on top of those. -mental