Re: Retired programmer wants to learn programming



In article <pan.2006.01.30.03.01.04.660768@xxxxxxxxx>,
ben.usenet@xxxxxxxxx says...
> 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?"

Uh, no - that's changing it, not rephrasing it. He said recursion, a
tool that makes you say "Ah - so that's how I write a chess game, or
generate a list of permutations, or search a graph". Whereas a
description of higher-order functions is more likely to make you go
"Huh...?".

> 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.

Not me - I keep pointing out that whatever faults our friendly
procedural or OO languages have, they do not include the absence of
recursion!

> 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.)

If a given problem can be solved with lower-level patterns in Java, I
think Java comes out on top - probably even for learning. Learning how
to solve problems in difficult ways is not necessarily the best thing
to learn...

- Gerry Quinn

.



Relevant Pages

  • Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
    ... Sounds like recursion to me. ... special purpose language - maybe they are not needed. ... >> This corresponds best to my second example of iteration. ... I am not wild about Java, ...
    (comp.programming)
  • Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
    ... > recursion to define an ordered set, that does not imply (as you imply ... programming in something like Java. ... >>> abandon Java in favour of a toy language that is limited to them and no ...
    (comp.programming)
  • Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
    ... Sounds like recursion to me. ... > special purpose language - maybe they are not needed. ... Go to www.jobserve.co.uk and type Java XSLT in your search. ... >>> This corresponds best to my second example of iteration. ...
    (comp.programming)
  • Reply to Gerry Quinn - Perils of Java Schools.
    ... >> Most Java(any imperative language) programmers will instinctively opt ... >> for an iterative solution and will only use recursion when they are ... In those situations your imperative programmer takes a lot ... > abandon Java in favour of a toy language that is limited to them and no ...
    (comp.programming)
  • Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
    ... >> Most Java(any imperative language) programmers will instinctively opt ... >> for an iterative solution and will only use recursion when they are ... Ask an average Java ... In those situations your imperative programmer takes a lot ...
    (comp.programming)