[plt-scheme] The perfect teaching language--Is this too much to ask for?

From: Marco Morazan (morazanm at gmail.com)
Date: Mon Jun 15 01:22:36 EDT 2009

>
> I think part of the point here is that humans classify, and are used to
> the idea that kinds -- kinds of rice in the pot, kinds of screwdriver in
> the toolbox, etc., matter to the effectiveness and correctness of
> processes that involve working with stuff.  The application of that
> intuition to programming is not a large leap.
>

Correct, no it is not. Let me be clear. I am not advocating that we do
away with types. I am not advocating that types are not useful in some
circumstances. There is a difference, however, between what is a type
(this has a formal meaning in CS) and the kind of  and how data is
manipulated. Types are useful, for example, to enforce abstraction
barriers (e.g. stops the programmer from manipulating a bignum as an
array of integers). There is no type system in the world that is going
to tell me that my program is correct. In fact, many beginners fall
into the trap of thinking that because their program got passed a type
checker it must work correctly. Why do they believe that? IMHO,
because when they started out programming getting passed the type
checker was the "biggest" obstacle.

In HtDP, contracts serve the purpose of classifying the kind of input
and output is expected. So, yes beginning students can put "things" in
boxes according to their kind. The nice thing, however, is that if
they put things in the wrong box the error can be discovered by
experimentation at this beginning age. No need to get passed a type
checker! :-)

-- 

Cheers,

Marco


Posted on the users mailing list.