Austin Ziegler austin@halostatue.ca wrote in message news:20020908044555.JCUL3718.tomts17-srv.bellnexxia.net@hogwarts…
def fun(foo)
…
end
to me seems to be much cleaner than
fun(foo):
…
or
sub fun(foo)
{
…
}
whereas the latter will come up again with blocks.
(Haven’t you ever seen this in Ruby? :
}
}
}
}
}
)
When learning Python I first had problems with indentation,
as different editors handle tab and spaces different.
At least I got my jedit configured using ‘spaces as tabs’
and found a vi option set useful for Python-writings.
I found reading Python sources as easy as reading
formatted prosa text, without unnecessary end- or brace-chains
at the end.
BUT … :
even though they ultimately mean the same thing. From a computer’s
perspective, it’s far easier to track scope with single-character
symbols (and it helps with editor paren-matching, too); IMO, from a
human’s perspective it’s far easier to track scope with meaningful
tokens than merely by space (especially since a single space error
can cause compile problems).
… at least I detected that I want to do text formatting
and indentation how and when I need it.
This was when I almost decided to use Python as my one-and-only
language and looked to different use cases.
Oho! I learned that the typical Unix-Shell-One-Liners are
very hard, if not impossible. (So I was attracted by ruby -e and
companion options).
I learned, that there exists indeed an embedded Python
(like php, eperl) but works only with some special syntax
add-ons and twists, because in this case you need to declare
where the end of a block is. (So I was attracted by eruby).
My result: Ruby is the better choice for one-for-all.
And regarding teaching to novices:
Seeing that today in germany many teens learn the first
steps in programming just in the school (and not in
universitary context), it would be great to see that they
get familiar very early with the basic principles, also
that a block has a beginning and an end, like in the most
other languages they will encounter later.
(marginal note: I would prefer using script languages to
teach 'em programming, to have them learn basic subjects
from the first ‘if’ until ‘use of tcp-sockets’ instead
of only teaching a ‘language’ without principles or concepts.
Unfortunately in our schools the CS-lessons are given by
arithmetic teachers, which learned writing Java, and they
only teach their pupils writing Java.)
Bye
Dirk Detering -aka Det