On 05/01/12 10:52 AM, Liam Proven wrote:
On 4 January 2012 01:22, Toby Thain<toby at
telegraphics.com.au> wrote:
On 03/01/12 10:09 AM, Liam Proven wrote:
On 3 January 2012 13:57, Toby Thain<toby at telegraphics.com.au> wrote:
On 03/01/12 7:14 AM, Liam Proven wrote:
>
>
> On 3 January 2012 04:16, Toby Thain<toby at telegraphics.com.au> wrote:
>>
>>
>> On 02/01/12 10:00 PM, Mouse wrote:
>>>>>
>>>>>
>>>>>
>>>>> I consider BASIC to be an excellent beginner's introduction to
"what
>>>>> is a program?", etc., so long as they are exposed to other
languages
>>>>> immediately after grasping the basic principles.
>>>>
>>>>
>>>>
>>>> Well, there is the "small" problem that BASIC syntax, data
types, and
>>>> control structures relate poorly to modern languages and even less to
>>>> powerful abstractions.
>>>
>>>
>>>
>>>
>>> I'm not convinced that's a problem.
>>>
>>>> What's wrong with Scheme? Or at worst, Python?
>>>
>>>
>>>
>>>
>>> The same thing that was wrong with the New Math: you don't dump the
>>> full load of theory on a beginner, not unless you want a very confused
>>> beginner, or you have the incredible luck to get a Ramanujan or Knuth
>>> as a student (and if so, honestly, the best thing anyone can do is to
>>> get the hell out of the way).
>>
>>
>>
>>
>> Scheme has no more theoretical load than BASIC.
>
>
>
> O_o So speaketh a *highly* intelligent, perhaps near-genius-level,
> natural programmer.
Of course, I meant to qualify this as: "for a beginner", which is the
point
here.
Even worse.
There is a core question here which you seem to be skipping over. Do
you want to teach people to write code, to be able to make a computer
perform new tasks? *Or* do you want to train professional software
engineers? These are not at /all/ the same thing. Indeed I'd submit
that they are barely related.
If you want the latter, then sure, yes, Scheme or Lisp or something
Exactly the reverse. Professional software engineers I've seen around
wouldn't touch Lisp with a barge pole. While, for people who want to get
stuff done elegantly and simply, without irrelevancies, Scheme is ideal.
clever and rather arcane. Start 'em on the
hard stuff so they learn
It's not hard stuff (q.v)
Believe me, as someone trying to learn Lisp, IT IS.
For you, yes. We hear that. It's not clear they are objectively hard.
I'm not a genius. And worse, like you, I have decades of imperative
imprinting, as well.
right, in
the same way that I learned swordfighting with a foil, the
feeblest weapon but the one controlled by the strictest rules. If you
can fight foil, then you can move to the less-demanding sabre easily,
and the relatively undemanding ep?e is straightforward; but start with
ep?e and learning the formalities of foil will be much harder.
Since modelling and abstraction are far more
important parts of
"programming" than syntax, BASIC fails completely:
- full of irrelevant lexical bullshit and limitations (line numbers?
what
good is this to a beginner?);
Oh come off it! Line numbers went out in 1985, man! Don't judge BASIC
by the crappy implementations of the early 1980s when 8K of RAM was a
lot!
Line numbers are not the issue.
*You* raised them as an issue.
They are an annoyance, but you can take them away and all the other
probems remain.
- numbers, strings, fixed length arrays? that's
it?
No, not at all. I would expect at least integers, floats, variable
length strings, multidimensional arrays of any other type, and quite
possibly different lengths of integer and possibly signed and unsigned
forms. Possibly booleans and things as well; maybe a complex type. But
to be a programmer does not mandate being a mathematician. I have
taught programming to people who did not know what a percentage was,
who did not know how to multiply or divide by fractions and so on.
Many people do not need fancy types.
How do I build anything
else? Oh right. I can't.
Again, a limitation only of very primitive, early BASICs, although I
have to say, I never found it a limitation. Have user-defined
structured data types if you want, though.
Can I make a list?
I have no idea. I have not programmed in any meaningful sense in over
20y. I would expect so, yes.
How?
- most BASICs lack structured programming
primitives, so even as an
IMPERATIVE language it fails to teach important patterns from the 1980s
(which might explain some of the code I see around the place);
Again, a limitation of the early 1980s. Not true of any decent BASIC
from about 1983 onwards.
- lacks named functions& procedures
(yeah, some BASICs have a crippled
hack for this; see lexical bullshit above)
See above. Have you actually *seen* /any/ even 1990s BASIC, FFS?
- a fundamental
abstracting/factoring tool.
You'll have to explain what that means.
Functions are a fundamental abstracting/factoring tool. So they better work
well. -> Closures, too.
Even the very early 1980s BASICs included functions. I don't think
I've ever used one that didn't.
As for Closures, AIUI, many computer languages do not include them.
Pointess crippled tools like C, for example. TBH I do not even
understand the Wikipedia definition of what a closure /is./
JavaScript does. PHP does. (Inelegantly of course.) Are these obscure
languages? Closures are being retrofitted to many "mainstream"
languages, apparently out of red-faced embarrassment, and/or to leverage
skills investment, claw a few years out of these superannuated
environments, etc.
As for Wikipedia -- I long ago stopped expecting to find neophyte level
expositions in it. For that, I go to pedagogical texts on the subject
(see other reply).
Now with Scheme,
- you start with a syntax that is not pedagogically toxic;
But is incomprehensible
To you...
The unreadability of Lisp syntax is widely agreed, /even by the
creator of Lisp./ It is often cited as one of the main reasons for the
lack of penetration of Lisp in mainstream business computing.
The alleged "unreadability" is actually an artefact of familiarity. You
didn't learn the language, how could you read it easily? Did you learn
Greek? Can you read Greek?
It is only familiarity that leads people to say that C, C++, PHP are
more readable. With those glasses taken off, they are horrible.
and uses
bizarre postfix notation.
Not Schemes I'm familiar with.
Prefix notation, then. Whatever the hell you call this (+ 1 2 3 4) nonsense.
As was pointed out in another reply, prefix notation has several
advantages. Do you just refuse to see them? They might be easier to
appreciate with actual experience of S-expression notation (there are
reasons it's still with us after nearly 50 years).
- you have the breath of a hope of constructing
useful data structures
without artificial limitations which can only frustrate;
Straw man.
- there is the opportunity to introduce more
theoretical load, which is
good. The door is always unlocked to go beyond where one already is.
If you can grasp the basics, pardon the pun, which I doubt most could.
There is nothing here that cannot be taught to a
high school age student.
You have no real experience of actual high-school students, then, I
can see that.
Not true; I know some who are learning Scheme and Haskell with no trouble.
/Some./ *Some* kids also learn ancient Greek or advanced
undergrad-level algebra when they are under 10.
I will never manage to dent your conviction that these things cannot be
taught to ordinary people. Oh well.
> I have only read a tiny little bit about Scheme
but it is virtually
> impenetrable to me - and I have years of programming experiences,
And that is EXACTLY what Dijkstra was on about.
Oh bollocks!
Q.v. Dylan:
http://en.wikipedia.org/wiki/Dylan_%28programming_language%29#Syntax
Q.v. Lisp 2 and Elephant, discussed here /passim./
Even John McCarthy himself later conceded that Lisp's syntax was a
major hindrance in teaching it.
Oh, yes, people have been trained to be terrified of it. It's a phantom
fear.
I could not disagree more strongly. There is, I suspect, a certain
mindset that can learn new mathematical notation and quickly and
easily adjust to it. To the common man, though, mere algebra itself -
simple
x = a - b
x is 10, b is 10; what is a?
... level-stuff - is as good as hieroglyphics. It is bizarre,
byzantine, impenetrable. But if you show them a language that says
?
apples = 5
oranges =10
total_fruit = apples + oranges
print total_fruit
?
And they can do that right at the command line, and they can save it,
edit it and change it and watch the results change - than that is a
useful teaching tool for introducing the notions of computer
programming to complete beginners.
I have read the first few pages of The Little Schemer, generally
hailed as the best introduction to Scheme there is, and I found it
completely incomprehensible - and I am a skilled computer professional
with around a quarter century of experience. If I can't follow it, I
really do not believe that a random person with neither interest or
aptitude for it will be able to.
Maybe you should just give up on that. Keep doing the stuff you are good at.
But let other people who need these tools try to learn them, as
desperately hopeless an endeavour that may be... (Btw, without
functional programming, there would be no Google search or PageRank. Or
Erlang. You do realise why Erlang is significant, right?)
The conclusion YOU come to is that Scheme isn't
relevant to programming.
That is not even remotely /like/ the conclusion that I came to. You
are putting words in my mouth and I *object*, strenuously.
I did not say it was not relevant. I did not say it was a bad thing to
start with. I said it was /too hard/ for the average person, and I
stand by that.
But
in fact the opposite is true: A good part of what you have been
indoctrinated with, from BASIC onwards, *obscures* what is really going
on
when you program. Programs are not "sequences of instructions" except at
the
absolute bottom-most level.
You have no idea of what any BASIC from even 20y ago is like, as you
have demonstrated, and you also seem to be very unfamiliar with the
limitations of actual ordinary people. For nonspecialists, concepts
such as loops are quite hard at first. Iterative thinking has to be
learned. Starting off utter newbies with prefix notation, CAR and
CADR, lists versus atoms, quoting and lambda calculus is like taking
the play-blocks off a kindergarten class and asking them to build the
cathedral of Notre Dame instead.
We do not need *another* generation of
programmers for whom recursion and
higher-order functions are alien concepts. Worse: Not given proper tools,
mental and literal, for modelling and abstraction. Abstraction, it can be
argued, is the single most important idea to learn as a computer
programmer.
Actually, I am sure you're right.
But this misses the strength of the old BASICs of the late 1980s and
1990s: that they brought programming to the common man.
Yes, that's true; but it is 2011. And we are preparing kids whose careers
will peak in 2030.
Very *very* few people's careers are going to involve programming
computers. One in a million, maybe, if that.
Oh, *if only* that were true.
Sure, we
need better developers, but we /also/ need easy, friendly,
fun tools to reintroduce the ordinary Joe to writing programs at all.
Python and so on are far too big and complex for this.
I too learned with assembler, BASIC, Pascal, C,
and so on; but I didn't
really learn anything except how to navigate limitations. Ugh. If only I
had
picked up Scheme when I picked up C.
So in fact BASIC did /not/ give you brain damage and stop you learning?
C moreso. I should have picked up something I could learn more from.
Actually none of these are more difficult than
the artificial hurdles
BASIC
puts in front of you. Once again you speak from your confessed
"imperative
place".
You have shown that you don't actually understand how much BASIC moved
on from the crappy MS BASIC 4 days of 1980.
Now imagine that you had learned Scheme first.
Would you say recursion
was
hard?
It isn't. I've written recursive programs. In BASIC. In a good BASIC:
in BBC BASIC V, a very fast, 32-bit BASIC with full support for named
procedures, local variables, passing by reference and value and so on.
I'm very very familiar with BBC BASIC. It can't by any stretch be compared
to a Lisp or ML family language, for example.
I am sure it can't and I am not arguing that. What I saying is that it
was a world away from the simple crappy early BASICs which didn't even
have if/then/else or more than single-letter array names.
I agree. I liked it a lot. In 1983. But soon found I liked Pascal better
(and then fell into the C trap).
And BBC BASIC was in many ways superceded by later developments like
QuickBASIC, which was a quite grown-up, structured language, written
in a simple IDE so that it could dispense with the line numbers that
you hate so much.
(Personally, I think that for an interactive interpreter, line numbers
are a simple, useful concept. If you type in language statements, they
are executed; if you prefix them with a number, they are stored, for
later execution. I see them as no more iniquitous than row and column
identifiers in spreadsheets.)
They are problematic in programming languages, being cognitive load, and
a conceptual irrelevance.
> > How will you program effectively in
2030 without dealing with higher
>>
>> order functions, continuations, immutable state? (How can one do it
>> today,
>> for that matter; only because in software Things Move So Damn Slowly.)
>
> I don't, because I am not a programmer and I don't aim to be.
>
>> Kids being educated for a career in software starting today deserve
>> something better than BASIC. Things are bad enough already.
*For a career in software*. That is the $64K statement, an
all-important qualifier.
So let me spell out what I am trying to say very clearly.
If you are trying to teach a child - possibly an under-10 - about
programs and logic and execution and evaluation, then a decent BASIC
is actually a pretty good tool. Most of these kids will never be
programmers, they will at best /use/ computers, but this gives them
the rudimentary core understanding. For a non-programmer, it is
enough.
For such purposes, a good, structured BASIC is an excellent tool.
If you are trying to teach an undergraduate university student reading
computing, computer science or information technology about the art of
programming, to make them a skilled programmer who is capable of going
on to get a degree or multiple degrees in disciplines around
programming, then from what I have read, yes, Scheme is an excellent
teaching tool. I would expect these to be highly intelligent young
people, the cream of the crop, with a background education in
mathematics.
These kind of people *aren't* highly represented among working
programmers - in a perfect world they might be - and that's a problem
for the industry.
And quite possible for any undergrad in the sciences, who one can
therefore expect to be intelligent and used to structured thinking and
reasoning and the basics of maths and algebra, then yes, for them too,
Scheme is probably an excellent teaching tool.
They
deserve something better than a 1970s BASIC, sure... But even a
late 1980s BASIC would, I submit, be more use than Python or Ruby,
which are too big, too complex and too abstract.
And after that, where will they fill in the missing pieces in their
education?
You need to define who we are talking about here.
Are we talking about:
[a] nonspecialists who will never program again, apart from maybe some
formulae in spreadsheets?
[b] nontrained people, nonspecialists, who drift into doing a bit of
scripting or basic coding, like most people in IT support?
[c] trained professional programmers with higher-education training in
programming and programme design?
For group A, I think a good BASIC is ideal.
For group B, possibly something more pragmatic like Python
For group C, yes, I think the Lisp family is probably best, and from
my reading, I'd say that Scheme is probably the best candidate for
teaching purposes.
But I think that Scheme or the like would be overkill for nonspecialists.
We can't identify in advance which group a particular child will end up
in, so whatever we choose to do will be taking a punt.
I tend to agree that 'modelling and abstraction' (what programming
really is, at least, at the professional level) is not going to serve
all beginners. Some people just don't care about that and want quick and
dirty fireworks (Arduino fans, geeks).
It's always going to be a compromise.
I only hope that people who DO end up graduating and working in the
field sooner or later get exposed to something a bit more mind-expanding
than the burger-flippin' languages around.
"A language that doesn't affect the way you think about programming, is
not worth knowing." -- Alan Perlis
--Toby