On 6 January 2012 04:51, Toby Thain <toby at telegraphics.com.au> wrote:
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.
The objections are not trivial and are not idiosyncratic to me. I
don't see why you wish to completely ignore the peculiarities,
weirdnesses and just-plain-hard-work bits of /your/ chosen teaching
language while damning mine out of hand because of its limitations.
This is, perhaps, a little like the previous argument about Unix
shells versus, well,
every-other-type-of-shell-but-exemplified-by-Windows' shell.
I have absolutely no argument that the Windows shell is less capable
and less powerful than sh/csh/bash/zsh/$OTHER_UNIX_SHELL. My point was
that the Windows one is actually better at the mundane everyday stuff
I need - i.e. things like mass file renames/moves/copies - than the
Unix type. The Unix ones make this stuff harder - more work, more
syntax, writing mini one-line scripts and loops - so that whereas they
can do far more, I don't /need/ the extra facilities whereas the
missing simple stuff is a major drawback.
Late-period BASICs are structured, procedural, support user-defined
types and data structures and so on. No, they don't support lambda
calculus, closures and so on - but nor do lots of other extremely
widely-used languages. This does not mean that they are useless or
indeed crippled or limited. A good BASIC makes it easy to put together
simple programs to do simple things. It would not be my choice for
writing a compiler or an OS kernel, no; it has limitations that make
it poorer for this than other languages. But that's not reason to
dismiss it. Simplicity and easiness are powerful virtues.
I am trying to learn about Lisp-like languages, because I am intrigued
by them. However, the learning curve is formidably steep and asking
around I have met many many programmers who have either never met
them, or tried and failed, or didn't "get it", and Lisp syntax is an
industry joke. I knew "legions of irritatingly-stacked parentheses"
before I'd ever seen a line of code or knew who invented it, why, or
when.
There has been one well-documented attempt to create a Lisp-like
language that uses the notation of, well, virtually every other
mainstream programming language *ever*.
(Except, arguably, Forth and Postscript, neither of which are
particularly mainstream. Yes, millions of machines contain
interpreters for both, but few humans write code in them. Hundreds of
millions of machines contain operating systems in the TRON family
(
http://en.wikipedia.org/wiki/TRON_Project) but few have ever heard of
it, seen it or interacted directly with it.)
The Lisp-like language I'm talking about is Dylan, and it has almost
died and lies ignored and moldering. I think that's tragic - the
snippets of Dylan source code I've seen are the most readable of any
of the Lisp family by a country mile and also outdo Smalltalk for
comprehensibility.
Compare and contrast these code snippets:
http://en.wikipedia.org/wiki/Dylan_(programming_language)#Syntax
One is impenetrable unless you already know Lisp and its notation. The
other is readable by pretty much anyone who knows any form of
programming language of any form ever.
If you do not think that is a powerful and compelling advantage, then
the maxim "there are none so blind as those who will not see" has
seldom if ever applied more strongly.
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.
Whereas I am willing to concede that the language has limitations, I
submit that [a] this is acceptable in a language for beginners - and
let us not forget what the B of BASIC stands for - and [b] that many
users might never hit those limits in their working lives.
> ?-
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?
I have never used or implemented a list in my life. I've never needed
one. I /once/ wrote a bit of code to /follow/ a list. But if the
language is Turing-complete, then you can implement one if you need
to. Me, I'd probably do it with an array with a dimension for the
contents of an entry and dimensions for links to the preceding and
following entries or something like that.
Not all BASICs do it, but I've used some that permit flexible-sized
arrays, that can be enlarged or shrunk on demand. Very handy that,
sometimes.
> ?-
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.
[Shrug] I'm sure you're right, in which case, should someone want to,
they could be retrofitted to a BASIC as well, no?
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).
It's the best freely-available general-contents source I am aware of.
If there are better, do please tell me!
> 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?
The alphabet, yes. The language, no. Science degree - you need to know
the alphabet.
The thing that you seem unwilling to address is this.
For one language - or one family - to use a non-algebraic notation,
one that is therefore unfamiliar to most of the literate, numerate
human race, i.e. most programmers, is a very major issue. The
advantages of that notation would have to be pretty damned stunning to
make it worth the while, because even Lisp textbooks, of which I have
several, all tend to devote a chapter or two to teaching the notation,
complete with exercises and notes to the effect that "we know this
seems weird, but it gets easier with practice, believe us".
Example:
http://nostoc.stanford.edu/Docs/livetutorials/lispintro.html
Quote:
"This seems complex (or at least verbose!), but when you get used to
it you'll find that it's actually very easy to follow, and incredibly
convenient in many ways. Here are some others to try out. See if you
can figure out what they evaluate to before trying them::"
Why should programmers *have* to get used to it? The existing notation
that everything else uses is not broken. People do not need pages of
exercises to get used to it. They do not have to do exercises in order
to work out what an expression means.
The *job* of a high-level language is to make life easier for human
beings, or we'd all write everything in machine code. A language which
needs people to learn new, difficult patterns and practices because
they are more convenient for the interpreter or compiler, or are
easier for the program itself to manipulate, is a language which is
biased in favour of the computer and the implementer and against the
user, and that is a very profoundly dangerous direction to take. I
might go so far as to say it is a serious flaw.
That in itself is an admission of failure. McCarthy admitted this
inasmuch as he eliminated it from Lisp 2, AIUI. What higher authority
do you need? That is /ex cathedra./
It is only familiarity that leads people to say that C, C++, PHP are more
readable. With those glasses taken off, they are horrible.
I think all are pretty horrible, yes, actually. :?)
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).
No, I do see them, and I have carefully worked through the exercises
and tutorials to get the hang of it. (More or less.)
After this and after due consideration I do not think that the
advantages outweigh the costs.
I freely admit I don't know enough about it to confidently say this,
but others agree and I think that the argument needs to be heard.
> ?-
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.
It is not that. I submit, though, that as someone who has taught for a
living and who still writes technical documentation for a living, it
is so very common as to be almost a general rule that
technically-minded people fail to truly grasp how /non/
technically-minded ordinary people are... and also, I am afraid, just
how relatively dim ordinary people are compared to techies.
Ubuntu, to pick an example, while it is busily alienating Linux
techies, has set out to be "Linux for human beings" - a superbly
/easy/ Linux which non-techie non-computery people can just pick up
and use. Result: it is the world's most widespread Linux by a country
mile and it achieved this within a few years, after 15y or so of
almost no general penetration of Linux at all beyond hackers and
geeks.
There is a big important need for simple tools for the rest of us. The
complex, difficult, hard-to-learn tools are great for expert,
competent people, but most people are not competent or expert.
Linux is brilliant, powerful and free.
But there are at least 5x as many Apple Mac OS X users - and probably
10x as many iOS users as them. Not because it's more powerful - it
isn't. Not because it's cheaper or runs on more kit - it doesn't; it's
commercial and only runs on one make of computer.
Why? Because it's /easier/.
>> 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.
I might do, but I have an article to write all the same!
But let other people who need these tools try to learn
them, as desperately
hopeless an endeavour that may be...
Are you deliberately misinterpreting me?
I am not for a moment saying it's hopeless, or impossible, or
pointless. That is absurd.
I am saying it's hard. That is not controversial or contentious, but
you appear utterly unwilling to even concede it for the sake of
argument.
(Btw, without functional programming,
there would be no Google search or PageRank. Or Erlang. You do realise why
Erlang is significant, right?)
No. Why?
> 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.
I was way out in my guesstimate. It is still a tiny minority of people. Agreed?
And it would be better if more people understood it. Agreed?
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.
You seem to fail to consider a far larger cognitive load for
beginners: that without line numbers and the simple, interactive mode
that they supply, then suddenly a whole ton of other complex
abstractions must be mastered: the notions of "editors" and "files"
and loading a file into an editor to modify it, then "saving" it into
a "filesystem", then quitting the editor and running arcane specialist
tools with no real-world equivalent, that is, a "compiler" or an
"interpreter", against your "saved file" and examing the
"output".
This is a /much/ bigger "cognitive load" on a complete newbie.
For someone computer literate, it's trivial, but you have to /become/
computer literate /first./
> ?> ? ?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 you think starting beginners on something harder would /help/ this?!
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.
Agreed. But you need to try to provide a gentle learning curve for
children or they won't bother trying to climb it at all.
Perhaps Logo is a better answer than BASIC; I don't know! But I am
pretty sure that Scheme is *not.*
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.
Definitely - agreed.
"A language that doesn't affect the way you think about programming, is not
worth knowing." -- Alan Perlis
Good line. But before it can be valid, one has to think about
programming at all. And that means there must be an initial
learning-to-program stage, before one /has/ thinking that can be
changed.
--
Liam Proven ? Profile:
http://lproven.livejournal.com/profile
Email: lproven at cix.co.uk ? GMail/G+/Twitter/Flickr/Facebook: lproven
MSN: lproven at
hotmail.com ? Skype/AIM/Yahoo/LinkedIn: liamproven
Tel: +44 20-8685-0498 ? Cell: +44 7939-087884