Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!mcsun!ukc!icdoc!qmw-cs!mmh From: mmh@cs.qmw.ac.uk (Matthew Huntbach) Newsgroups: comp.edu Subject: Re: Pascal as a first Language Message-ID: <2560@sequent.cs.qmw.ac.uk> Date: 25 Jul 90 13:44:27 GMT References: <24994.26a7079d@kuhub.cc.ukans.edu> Reply-To: mmh@cs.qmw.ac.uk (Matthew Huntbach) Organization: Computer Science Dept, QMW, University of London, UK. Lines: 62 Summary: Expires: Sender: Followup-To: Distribution: Keywords: In article <24994.26a7079d@kuhub.cc.ukans.edu> cs300@kuhub.cc.ukans.edu writes: >Some of my reasons: >The main technique to learn is abstract data types and modularity. >Pascal adds all kinds of syntactic overhead to the structuring of >data (e.g. "." vs "[]" for essentially the same thing: compound data) I think the distinction between arrays - which are indexed - and records - which are not - is an important one. Of course, you should encourage the use of syntactic structures ONLY within procedures and functions which implement the abstract data types. In this way, the language syntax becomes a minor detail anyway. >Pascal forces everything to be declared globally if it is to retain its >value (i.e., there is no private data) I think this is acceptable for a first programming course. Introducing private data at this stage is only overloading the students. They will only get to see the benefit of private data as a result of experience, so it is better introduced in the second programming course. >Pascal punishes one for recursion (unless tail recursion is implemented) At the first programming course stage you shouldn't be worrying too much about efficiency. Students are unlikely to be writing programs where the inefficiency of Pascal's recursion implementation notices. >Procedures and functions are not first class data items and hence only >a small subset of programming techniques is learned. The use of higher-order functions often strikes me as a dirty programming trick, akin to the use of gotos. I don't think I have ever had to use it in ten years of writing programs. I have seen too many "clever" programs which make unnecessary use of procedures and functions as first class data items. I think it is best not covered at the initial stage. >Polymorphism is only difficultly achieved to a partial degree. Again, while polymorphism has benefits, at the initial stage there are positive benefits in NOT using it. Students ought to be thoroughly aware that a "list of X" is not of the same type as a "list of Y". > >Now, granted, some of these topics aren't always suitable for a first course, >but the teaching of Pascal means that in order to learn them, one has to drop >pascal (and all the bad habits its taught) and pick up a reasonable language. Any CS student worthy of the name ought to have no difficulty in switching languages. I don't think Pascal is perfect, but it's a reasonable compromise between various conflicting requirements. The important thing is to stress that it is being used as a teaching tool - making sure that students are aware you are teaching the principles of good programming, not "coding in Pascal". My main concern about the language is that many students coming to first programming courses already have a lot of experience with computers in high schools or as hobbyists. It is too easy to carry on bad programming techniques into Pascal. So I agree it may be good to shock them by introducing a completely different sort of language, either functional or logic. Matthew Huntbach