Path: utzoo!utgpu!water!watmath!clyde!rutgers!husc6!hao!oddjob!gargoyle!ihnp4!ihlpf!nevin1 From: nevin1@ihlpf.ATT.COM (00704a-Liber) Newsgroups: comp.lang.misc Subject: Re: Languages and learning (was: Philosophy of C) Message-ID: <3555@ihlpf.ATT.COM> Date: 30 Jan 88 01:24:22 GMT References: <11348@brl-adm.ARPA> <3473@ihlpf.ATT.COM> <3487@ihlpf.ATT.COM> <666@l.cc.purdue.edu> Reply-To: nevin1@ihlpf.UUCP (00704a-Liber,N.J.) Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 92 In article <666@l.cc.purdue.edu> cik@l.cc.purdue.edu (Herman Rubin) writes: >Nevin Liber said: >> Analagously, >> try teaching someone how to write a exponentiation routine with a >> Turing machine (or another simplistic model of a computer). > >That a Turing machine can do everything a computer can do does not make it >necessarily the only simple model of a computer, any more than the understand- Where in that statement did I say that a Turing machine was the ONLY simplistic model of a computer?? As previously stated, I was making an analogy and not defining abstract models of computers. As a matter of fact, I implied that there ARE other models for computers. >> Unless you have a >> higher level concept of what things like lists, queues, and stacks are, >> programming in assembler is extremely tough. There are no data structures in >> assembler, and this makes it tough to do any kind of non-trivial programming. >> HLLs are much better at learning the fundamentals of data structures and >> thinking abstractly. > >I do not consider lists, queues, and stacks as any more abstract than overflow, >GOTO, and the hardware organization of items. Data structures should be added >to the assembler; the HLL syntax, including weak typing, should be added. >Macros of the form > X = Y + Z >and > Q,R = M / N >should be added. Start with what the hardware can do and proceed accordingly. In order to add things like data structures and weak typing, you have to either build a more complicated architecture for a CPU and consequently add many more instructions to the machine language (what do the RISC folks think about that?) or restrict the assembly language so that it cannot be programmed to do everything possible on that machine. The latter should not be called assembly language. Typing is almost meaningless in assembly. What is the difference to the machine between a 4-byte float and a 4-byte int? Nothing. It is what we, the users of the machine think of those 4-byte values. Also, adding things like infix macros detract from the notion of what is really going on in the hardware (which is the reason this whole subject was brought up in the first place). There are languages around that satisfy your criterion (I think B, the predecessor to C, is one of them, but I'm not sure); if you think one of those languages would be good as a first language, then state your case. But please don't try to muck up assembly language; it is fine as it is for what people usually program in it for. >> One of the major habits is un-structured programming. > >I can give you examples where GOTOs are the simple thing to do, and the >"structured" alternatives are much more complex. Structured programming >can block thinking of the efficient way to do things. Please post some examples of problems (not solutions that are already implemented using GOTOs) where structured alternatives are 'much more' complex. IF many of these problems exist, I would like to discuss how we can 'fix' the structured languages to handle them more easily. >> Also, machine language allows self-modifying code, which is a no-no by today's >> standards. > >used. If self-modifying code is the thing to do, do it! This is one of the differences between hacking and programming :-)! Many operating systems will not allow you to modify code of a running system (for example: SVR3 Unix). Self-modifying, as well as non-reentrant code cannot be shared; ie, if sh were not reentrant then every time you fork a new process you would have to make a new copy of the entire executable for sh; our UNIX machines would run out of memory (real and virtual) VERY quickly. >> Machine language is NOT the place to start learning about computers or to >> program them. HLLs have too many advantages over machine languages. > >From the discussions I have seen, starting with machine languages _may_ be >more difficult. However, I believe that for each person who has problems >starting with even the bad machines languages, dozens who start with the >HLLs will never be able to understand how to program anything that their >HLL does not support. This would be true IF these people only learn one language. I did not propose that they never learn assembler, just that it should not be the FIRST one they are taught. Programmers should learn assembly language sometime; but only after they have developed some good programming techniques. It is much harder to 'unteach' somebody than it is to teach somebody. -- _ __ NEVIN J. LIBER ..!ihnp4!ihlpf!nevin1 (312) 510-6194 ' ) ) "The secret compartment of my ring I fill / / _ , __o ____ with an Underdog super-energy pill." / (_