Re: Retired programmer wants to learn programming

On Sun, 29 Jan 2006 13:01:14 +0000, Gerry Quinn wrote:

> In article <1138485133.589739.196200@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
> snarflemike@xxxxxxxxx says...
>> Thanks to everybody for the various suggestions. I found a comment in
>> Paul Graham's ANSI Lisp book online that applies to what I'm looking
>> for:
>> "Programming languages teach you not to want what they cannot provide.
>> You have to think in a language to write programs in it, and it's hard
>> to want something you can't describe. When I first started writing
>> programs-- in Basic-- I didn't miss recursion, because I didn't know
>> there was such a thing. I thought in Basic. I could only conceive of
>> iterative algorithms, so why should I miss recursion?"
> I would describe it as not understanding the language he was using. All
> BASICs have provided recursion in some form. It may have been somewhat
> limited on very primitive versions, but I have never heard of a version
> that did not allow functions or subroutines to call themselves.

The original quoted sentiment was not well put but it can be simply
rephrased and the point still stands. For example the author might have
said: "I thought in Basic. I could only conceive of named subroutines, so
why should I miss higher-order functions?"

There seems to be generally held view (so please note I am not ascribing
it to you -- I have no idea -- it was just you post that made me thing of
it again) that apart from all those blasted brackets the only thing that
separates functional-lispish-up-themselves langues like Scheme and Haskel
from down-to-earth-realistic-practical ones like C and Java is that one
set has recursion and the other interative loops.

This difference is really just a consequence of having promoted the notion
of a function so that its uses are not constrained. As a result, all
sorts of programming patterns can be captured without the need to add
further concepts (like loops).

There was another thread where the notion of recursion was pitched against
looping to see which was more "natural" or "intuitive". I'd say that
neither is. There very little we do as a species that is less intuitive
than programming, so neither has a strong claim. If Scheme is a "better"
language (for learning) than, say, Java it is be because it can express
higher-level ideas and programming patterns. You don't learn more with
it, you learn deeper. (I don't know Java -- it might well have
first-class functions etc. in wich case substitute C in the above and I
will go and learn Java.)