[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Functional Paradigm popularity and Maths (Was: XML as a transitionto s-expr)



On Tue, 18 Dec 2001, Don Blaheta wrote:
> Quoth Ash Searle:
> > I think an interesting and possibly unrelated question may be:
> >
> > If you could take a virgin programmer (of unknown mathematical ability),
> >     which programming paradigm would you teach them first?  And, why?
>
> Functional; if they really have had no programming experience, they can
> get up-and-running much faster in functional style.  There's just not as
> many core concepts they need to understand to get started (variables,
> mutations, strings; they don't even need to understand functions at the
> very start, though that's more due to the REPL than anything else).  In
> addition, if Scheme is the functional language in question, they have
> negligible syntax to learn to get started.

I would agree. I teach Scheme to about 200 non-science majors each year
and they can go much farther than the Java class. Most of the students
have no programming background (being from the humanities or arts or
social sciences). In one semester they can write servlets, applets, trace
through fairly sophisticated functions (e.g., log-time exponentiation...).
They do have trouble with paren matching, but its more at the nuisance
level than the conceptual. Also, when they write HTML they
also have trouble making matches, its just that the browsers usually don't
complain and try to do something reasonable ... Trying to teach such a
course in Java would create problems on several levels:

 * too much syntax for novices to quickly absorb (public static final Double ...)
    f(a)  x.f(a)  java.lang.System.out.println(...) )

 * too complex a model (objects, instance/static variables/methods,
   constructors, packages, parameter passing, ...),

 * too much effort required for conceptially simple operations
   (e.g. gui layout, servlet form processing)

For servlets we use a servlet container that allows HTML to escape into
scheme (with <scheme> ... </scheme>) and the scheme also can escape into
html with <xml> ... </xml>) The students find this very easy and fun.
I have only taught Scheme and Java at this level and so don't know how
well Python, Ruby, or Perl would fare.

---Tim---