Thread View: comp.lang.misc
4 messages
4 total messages
Started by Barry Shein
Fri, 09 Jan 1987 21:47
Re: Check the Arg Count
Author: Barry Shein
Date: Fri, 09 Jan 1987 21:47
Date: Fri, 09 Jan 1987 21:47
94 lines
5428 bytes
5428 bytes
From: sommar@enea.UUCP (Erland Sommarskog) >Well, I may missunderstand what you mean, but to me it seems that you are >trying to say that type-checking languages like Pascal, Ada etc are inferior >to languages that are more relaxed at this point, like C. Also you seem >to imply that type checking is only for bad programmers. Perhaps its semantics. You call it type-checking. I'll call it type-obsession. When type-checking becomes so strong as to make it impossible to write a general purpose sort() subroutine or string handling library then yes, it is type-checking gone mad. It reminds me of a rather novice programmer I once worked with. Her previous job was as an assembler programmer on a machine that had no multiply instruction. She told me the first thing every new programmer there had to do was write a multiply subroutine for themselves. Think about it, every piece of software coming out of that company had a different multiply routine packaged in it. I don't see things as much different in the Pascal world. Software just isn't re-useable. >Actually, I can't escape the feeling that the people who advocates >relaxed checks are those who are bad at good design. The more of tricks you put >into it, the harder to understand it is. A good programmer don't feel >restricted by a checking compiler, he feels supported. Do you think writing a sort routine or string package once and reusing it a 'trick'? How about a math library? >Finally, one note a bout Pascal since you mention this language. As we all >know, Pascal was never ment for "productive" programming, just for >education. On the other hand, the most compilers do offer extentions >for separate compilation, string handling etc. Of course these extentions >doesn't make Pascal very portable. By the way, as far as I know the most >of TeX is written in standard Pascal, but you perhaps would call that >useless software? First, I think it was a mistake using a non-productive language (to use your phrase) for education. The leap from beginner to a person with certain views about the programming milieu happens far too fast to allow it to happen in such an artificial environment. The damage is obvious, we have people wandering the streets trying to do useful work in Pascal because that's what they were taught. The notion of extensions just makes it worse. It convinces the student that the computer field is a random collection of unintelligible hacks as textbooks don't match the language at hand nor manuals etc. Have you ever tried to explain to a student why the example he or she typed in from their textbook won't work without a major rewrite at the language level (bad enough if there's some O/S interface, but at the language level?) I have, they look at you like you're a snake oil salesman and I don't blame em. As to TeX, I know, it seems to be the only program ever written in standard pascal so everyone points it out when these things come up: 1. It's not really written in Pascal, it's written in WEB, Pascal is it's assembly language. In the same sense that a good HLL can make the fact that it's assembly language is assembly language fairly transparent, so can WEB. I mean, I can probably manage to write a compiler to turn my favorite HLL into Pascal if I had to, would that mean my programs were really in Pascal? Is Pascal really machine language because that's what it's translated to? 2. Have you ever actually looked at TeX, or better, tried to change something in the TeX source code? Try it, if you don't get sick you have a far stronger constitution than I do. 3. TeX is utterly standalone on purpose so it obviates any need for standard subroutine packages. Of course, the whole change file facility that had to be implemented leaves one only wondering about whether there was a rather large fundamental problem remaining to be solved. 4. In fact, the model of TeX is so simple it could be written in most any language. It takes an input stream of characters, classifies them (possibly into tokens) and transforms them into an output stream. I am not saying the details of this are simple, but I am saying that to do so it's not surprising that any language with a few simple operators was powerful enough for the job. It also has no need for any external standards (for example, a standard math package) as it defines its own standards. The only interface with the outside world it has is that it is able to read streams of chars and transform them to other streams of 'chars' (actually, a dvi file, but similar enough it's not worth beleaguring that point.) Of course, it has to be able to open files by name but then again that's exactly the part that has to be redone every time TeX is 'ported', it's a moot point. If you think TeX is the shape of the future of software engineering than god help us all... -Barry Shein, Boston University
Type and range checking
Author: Erland Sommarskog
Date: Sat, 10 Jan 1987 23:24
Date: Sat, 10 Jan 1987 23:24
71 lines
4184 bytes
4184 bytes
In article <3330@bu-cs.BU.EDU> bzs@bu-cs.BU.EDU (Barry Shein) writes:
>Perhaps its semantics. You call it type-checking. I'll call it
>type-obsession. When type-checking becomes so strong as to make it
>impossible to write a general purpose sort() subroutine or string
>handling library then yes, it is type-checking gone mad.
("Type-obsession", that was almost funny.) But if you get the possibility
to write the general-pupose routine WITH type checking? Pascal doesn't
permit that, but Ada does. OK, you mainly talk of Pascal, but at least in your
prevoius article you talked about "Pascal and its successors". I would count
Ada to one of them.
>had a different multiply routine packaged in it. I don't see things
>as much different in the Pascal world. Software just isn't re-useable.
That's why we have Ada.
>Do you think writing a sort routine or string package once and reusing
>it a 'trick'? How about a math library?
Once again, do it in Ada.
>
> ... discussion that claims that Pascal was a mistake as an
> introductory langauge.
I agree with you on this point. What Wirth and no one else probably didn't
realize is that the language you learn first is the one you know best and
the one you prefer. My first programming course started with Fortran and
concluded with Pascal. Though I use Fortran very little I know it quite well.
The use of extentions in Pascal doesn't make things better.
Wirth has since then introduced Modula-2 which is more or less just another
Pascal-extention. It's more flexible than Pascal, but it fails on the fact
that I/O isn't standardized.
To attach to another current subject, teaching Ada as the first language
would be much better. Ada is large but you don't have to learn all at once,
have you.
>
>As to TeX, I know, it seems to be the only program ever written in
>standard pascal so everyone points it out when these things come up:
>
> ... lots of details of TeX
>
>If you think TeX is the shape of the future of software engineering
>than god help us all...
Well I do not. I just gave a counter example of your assertion that very
little useful software had been written in Pascal. TeX is useful, isn't?
Or did you mean useful in the sense "reuseable"? That's a completely other
thing.
And so to the next guy:
From: holloway@drivax.UUCP (Bruce Holloway)
>Let the compiler do the type checking... so long as it stays there. Pascal
>puts in a lot of code for array overruns, etc., that are unnecessary for
>a well-designed program. You could turn all this off on the Pascal I learned
>on, which made it tolerable. But I don't want anything in the program I didn't
>put there -- if I'd wanted subscript checking, I would have added it.
Of course one should have array and subrange checking as much as possible
during the testing. Adding them yourself? But if you make a careless mistake
that makes them go wrong? And the time to write them? Don't we have computers
to do such things automatically?
Well-designed program? What about:
WHILE A(.i.) <> 0 DO
and you forget to initiate i? Bad design? With range check there is a good
chance the programme crashes immediately revealing the error. Without
range checking you may have to search a long time for it.
Of course a good compiler should have a switch to turn checking on and
off. I compile my programs /CHECK/DEBUG/NOOPTIMIZE (this is VMS) when I
develop, and when I imagine that they work I switch to /NODEB/NOCHECK/
OPTIMIZE. (The reason I exclude the optimizer is because it is very
fond of expanding procedures to inline code, which confuses you when
debugging.)
Re: Check the Arg Count (really, Types)
Author: debray
Date: Mon, 12 Jan 1987 15:09
Date: Mon, 12 Jan 1987 15:09
19 lines
1213 bytes
1213 bytes
Barry Shein:
> From: sommar@enea.UUCP (Erland Sommarskog)
>> [ ... ] Also you seem to imply that type checking is only for bad
>> programmers.
>
> Perhaps its semantics. You call it type-checking. I'll call it
> type-obsession. When type-checking becomes so strong as to make it
> impossible to write a general purpose sort() subroutine or string
> handling library then yes, it is type-checking gone mad.
What you want is a Milner-style polymorphic type system. There _are_
reasonable notions of what constitutes a "type" out there, even if Pascal
doesn't have them.
--
Saumya Debray
University of Arizona, Tucson
debray@arizona.edu
{allegra, cmcl2, ihnp4}!arizona!debray
Re: Type and range checking
Author: Lum Johnson
Date: Tue, 13 Jan 1987 23:43
Date: Tue, 13 Jan 1987 23:43
20 lines
1752 bytes
1752 bytes
In article <1638@enea.UUCP> sommar@enea.UUCP (Erland Sommarskog) writes: >In article <3330@bu-cs.BU.EDU> bzs@bu-cs.BU.EDU (Barry Shein) writes: >> ... discussion that claims that Pascal was a mistake as an >> introductory langauge. >I agree with you on this point. What Wirth and no one else probably didn't >realize is that the language you learn first is the one you know best and >the one you prefer. My first programming course started with Fortran and >concluded with Pascal. Though I use Fortran very little I know it quite well. >The use of extentions in Pascal doesn't make things better. Are you sure? I started with BASIC, went rapidly through FORTRAN, PL/I, ALGOL, and LISP, and ended up using assembly language because I can't cope with all the "help" compilers want to give me without my asking for it. I can't even tolerate PASCAL and its descendants. However, my favorite and best understood language is TECO, the "assembly language" in which EMACS is written. Of course, although I can write it quickly and easily, I can't really read it - almost no one can. Lum Johnson lum@ohio-state.arpa ..!cbosgd!osu-eddie!lum
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads