On Fri, Jun 06, 2003, Vadim Vygonets wrote about "C flame (was: FS/OS in schools)":
> > Actually, yes, it's the best programming language to teach the basic
> > concepts of programming and computer-science. (in my opinion).
> 
> Pascal?

I know Pascal well, and I actually used it a lot and liked it, so I won't
argue with you - Pascal is indeed a good language for teaching programming.
However, I still think C is better. Especially if those kids end up actually
using what they've learnt in real projects, and especially if you talk about
"standard pascal" (whatever that was) which was missing a lot of features
people have come to expect from C (Brian Kernighan even wrote once a paper
called "Why Pascal is not my favorite programming language).

My opinions here may be biased because I haven't used Pascal in nearly a
decade, since the days of Turbo Pascal 6 (when I used Pascal really heavily).
Maybe Pascal has made some sort of huge leap forward since, I don't know.

> Too much of "no magic" isn't good either.  It's great that C
> teaches you pointers, but it's not so great that you need to use
> pointers for call-by-reference (is it the correct terminology?).
> Memory allocation in C is too low-level, which results in more

I argue that these *are* good things to teach, because this is what
the call-by-reference and garbage collection in more complex languages
end up doing anyway.

Let's face it, when you teach someone to drive its enough to teach them
to use the pedals and the steering-wheel. But when you teach someone to
become a mechanic, you have no option but showing them what the engine
looks like by opening the hood, even if it's an ugly, greasy, mess.

> memory leaks in C programs than in comparably complex programs in
> other languages.  Strings in C are not a first-class type, which
> means that you need to work with them almost manually, peeking
> the characters from within the string.

Pascal has an even worse implementation of strings (the length of the
string was part of the type, last time I used Pascal!)... Anyway, C is
not a convenient string-processing language, I admit. I never said it
is the only language that should be learnt - languages like AWK and Perl
are much more convenient for writing simple text-processing programs.

> Pascal.  I would never dream of writing a real program in Pascal,
> but it's a good functional programming language for students, one
> of the reason being that the student can concentrate on learning
> concepts instead of fighting with pointers and memory allocation
> when it's not needed.

Please remind me - how does Pascal make it easy not to "fight with pointers
and memory allocation"?? Last time I checked, pascal did not have any
notion of garbage collection, and had both pointers and memory allocation
(not needed for strings, true, but in C you also don't need memory allocation
for strings if you always used fixed-length arrays!).

If you want a language with no concept whatsoever of dynamic memory
allocation, try Fortran 77 :) However, this is a copout: if a language
does not have memory allocation, it doesn't mean this feature isn't
necessary in real-life, as any seasoned Fortran programmer can tell you...

> No.  As I wrote in my response to Amos, it will stay because it's
> taught everywhere.  Also, UNIX with its language xenophoby (one
> word: libc) makes sure C stays as long as UNIX stays (yes,
> Bourne^H^H^H^H^H^HPOSIX shell will stay too).

I disagree that Unix forces people to use C. I know a number of people
that use UNIX and the only programming language they know is Fortran.
I know a number of other people who only use C++. Other people avoid all
of these and use Perl or Python. Knuth wrote TeX in Pascal :)
People continue to use C because, frankly, it's better at what it's being
used for. This is also why C succeeded in the first place, and why it ended
up replacing Pascal as a teaching language in the Technion, for example.

> These examples don't show the essence of Forth (which is quite
> interesting), but they show a couple of things in C that we
> consider for granted in programming languages, apparently without
> a good reason.

For a useful language similar to Forth, how about learning Postscript?
I'm not joking. It's actually more interesting than it sounds (and the book
is available freely on the net).

I never claimed that C should be the only language ever learned...
Logo is another interesting example, not only for the funky 70s-style
graphics, but also for its lisp-like syntax (lisp addicts: please don't
attack me here!).


-- 
Nadav Har'El                        |         Friday, Jun 6 2003, 7 Sivan 5763
[EMAIL PROTECTED]             |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |A city is a large community where people
http://nadav.harel.org.il           |are lonesome together.

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to