From: crawford@boole.mitre.org (Randy Crawford)
Subject: Re: first-year programming languages
Originator: crawford@boole.mitre.org
Organization: The MITRE Corporation, McLean, VA
Distribution: na
Date: Thu, 19 Nov 1992 00:06:28 GMT


In article <dnebing-141192140340@m64-143.bgsu.edu>, dnebing@andy.bgsu.edu (dnebing) writes:
> In article <aelman.721693402@Xenon.Stanford.EDU>, aelman@Xenon.Stanford.EDU
> (Adam Elman) wrote:

[Preceding comments advocating the teaching of assembly as a first or 
near-first language.]

>  
> > I disagree strongly with this for two reasons:
> > One:  Machine language is a _serious_ turn-off to people who aren't
> > already committed to computing. [...]
> 
>   I disagree with you because of this point.  Here at BGSU, we have two
> classes that students take before hitting the assembly language class,
> which must be like yours because it either makes or breaks the CS major.
> 
>   What happens in the first two classes?  The first two classes use
> Pascal.  The programming assignments are meant to teach the language
> more than the concepts.  When necessary, the students are practically
> given the basic code which they only have to modify for their own
> programs.
> 
[...] 
>   IMHO, the assembler course should have been first.  It would weed those
> out who really don't want to be there and also challenge those who do.

But programming in assembly has almost nothing to do with computer science.
Weeding out those CS majors who would rather not putz along in assembly 
would eradicate a lot of talented people who otherwise might excel at 
cognitive modelling or database work.

Like algorithms and computability, assembly has its place in teaching one
aspect of CS.  But don't make too much of it.  For all the same reasons
you advocate the teaching of assembly you could justify the teaching of
turing machine programming or DFA/stack machine/ATN machine programming.
And you'll probably find about as much use for them professionally as 
assembly since few commercial or government systems contain assembly any 
more.  The other computational models will illustrate implementation costs 
and tradeoffs just as well as assembly can.
 
>
> > Two:  Since when was machine language really a good introduction to
> > the "tools of the trade"?  Machine/assembly languages introduce a
> > single topic in CS -- that of memory and CPU behavior.  [...] I use
> > concepts such as algorithms, data structures, pointers, procedural
> > programming, etc. etc. in _all_ my CS classes (including the assembly
> > class, for that matter!).  _Those_ topics are what first-year CS
> > students should be learning.
>
>   It is _possible_ to show all of those things in assembler.  Higher level
> languages convert all of those things into assembly language.

Machine code, actually.  Perhaps they should learn recursion and semantic
nets using sub-mnemonic machine instructions...  

Just because you _can_ express exponentiation using addition doesn't mean 
you should.

> 
>   I am not trying to say that assembly language will offer the students
> the best way to get those concepts.  Some concepts would be very difficult
> to show.  In my opinion, to know assembler is to know the computer itself.
> The assembler class opened up a few problems that I had with C because
> I didn't fully understand what was actually going on.

Perhaps today, but what about tomorrow?  Will you better understand analog 
machines or neural nets or newer computational implementations like 
connection machines using computational models based on assembly?  Not in my
opinion.  I'd say you're better off understanding computational models in 
general, and _then_ move on to specific models like von Neumann machines and 
assembly programming.

> 
> > I would agree that there is a good amount of debate on whether the
> > emphasis of a first-year class should be on the ideas of programming
> > structures, etc., (languages such as Pascal or C) or algorithms
> > (something like Scheme, Lisp, or ML).  But I think that emphasizing
> > the bare-bones machine aspects would be crazy.
>
> A strong foundation in the bare-bones machine can help others to understand
> what happens with those data structures and algorithms.  When programming
> in assembler, every bit becomes important.  With higher level language, its
> importance is lost even though it can still play a part.

As always (it seems) a middle path which introduces both to the student has 
to be preferable to one OR the other.  As both opinions point out, both 
perspectives are valuable to the education of a computer scientist.  Which
course comes first really isn't that important.

> 
>   It is difficult to program in assembly language, anyone will agree.  But
> it can give a student a good understanding about the computer that he/she
> will be working with for the rest of his/her life.
 
I'm not so ready to predict that computers in 2020 will so closely resemble
today's crop of assembly machines.  After all, hasn't assembly programming
pretty much disappeared from most software development in the past decade?
Ever try to outguess optimizing compilers on architectures like SPARC or 
PA-RISC?  Think you could better their scheduling/pipelining/register-window 
use by programming in assembly?  If so, you're a far better assembly programmer 
than I. 

In a perfect CS curriculum, I'd like to see a first course like that at MIT, 
using Abelson & Sussman's SICP book and Scheme to learn programming/algorithms/
mathematical foundations.  Then I'd like to see sophomore-level intro courses on
algorithms and data structures as well as on discrete math and computational 
models.  I'd choose Sedgewick's _Algorithms in C_ book for algs/data structures 
and maybe Aho & Ullman's _Foundations of Computer Science_ for computational 
models and theory.  Then I'd demand additional algorithm and theory classes in 
the junior or senior years.  And at least one early course on _software 
engineering_.

In four years, I might not even _get around_ to assembly language programming.

 
-- 

| Randy Crawford        crawford@mitre.org        The MITRE Corporation
|                                                 7525 Colshire Dr., MS Z421
| N=1 -> P=NP           703 883-7940              McLean, VA  22102