Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!uwm.edu!ogicse!decwrl!megatest!djones From: djones@megatest.UUCP (Dave Jones) Newsgroups: comp.lang.misc Subject: Re: introductory language Message-ID: <12594@goofy.megatest.UUCP> Date: 13 Apr 90 01:59:01 GMT References: <4147@ethz.UUCP> Organization: Megatest Corporation, San Jose, Ca Lines: 32 In article <7300008@ux1.cso.uiuc.edu> cs290ac@ux1.cso.uiuc.edu writes: > >I'm looking for opinions on what languages people think should >be taught as introduction to programming for both CS majors and >non-CS majors. My initial opinions are C for CS majors because >of its popularity, and its low-level programming characteristics. > When I taught Introduction to Programming to C.S. majors, as a visiting associate prof for a couple of years, I largely ignored the _Oh! Pascal_ I was supposed to teach from (shudder!), and taught Dijkstra's method of invariants. But I think it is complete folly not to write and test actual programs. For that purpose, we had to use Pascal, as required by the University's curriculum committee. After much reflection on the subject, if I had it to do again, I would fight long and hard against using Pascal. I would start with a "toy" assembly language, following that with C, and then C++ with a good class-library. Introduce stacks and structures in the assembler phase. That will be the stepping-stone to C. Introduce information-hiding, encapsulation, etc. in C, then move to C++. In other words, rather than attempting to hide the machine from the students, I would try to help them learn how the increasingly "high-level" languages are of value and what exactly compilers and linkers and runtime library-routines really do. Languages that automatically do very complex tasks at runtime, such as unification, heap-management with garbage collection, task-scheduling, or hash-table lookups, would be deferred until the second course or later. Ditto for "functional" languages. I would always introduce new language features after having shown how the task which the feature automates would have been done using the lower level tools.