home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / forth / 3789 < prev    next >
Encoding:
Text File  |  1993-01-07  |  4.6 KB  |  104 lines

  1. Newsgroups: comp.lang.forth
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!torn!nott!uotcsi2!news
  3. From: cbbrowne@csi.uottawa.ca (Christopher Browne)
  4. Subject: Re: Documenting
  5. Message-ID: <1993Jan7.205519.27793@csi.uottawa.ca>
  6. Sender: news@csi.uottawa.ca
  7. Nntp-Posting-Host: prge
  8. Organization: Dept. of Computer Science, University of Ottawa
  9. References: <1492@eouk9.eoe.co.uk> <1993Jan7.142456.5519@titan.tsd.arlut.utexas.edu> <1993Jan7.190102.3517@mksol.dseg.ti.com>
  10. Date: Thu, 7 Jan 93 20:55:19 GMT
  11. Lines: 91
  12.  
  13. In article <1993Jan7.190102.3517@mksol.dseg.ti.com> strohm@mksol.dseg.ti.com (john r strohm) writes:
  14. >Larry Maturo asks for reasons why one user prefers blocks over files.
  15. >
  16. >I offer the following for consideration.
  17. >
  18. >Blocks forces every single chunk of code to fit in a very restricted window,
  19. >and it makes it darned near impossible to "slide" the window.  In my
  20. >personal opinion, based on the code that I have seen, this restriction
  21. >TENDS to force a greater degree of modularization, conciseness, and
  22. >coherence, as compared to code developed under programming support
  23. >environments that allow and even encourage the programmer to ramble on for
  24. >hundreds of lines.
  25.  
  26. This is one of the classic arguments of the "BLOCK apologists."  While
  27. the facts do go together, the causality isn't ALL that strong.  To
  28. wit:
  29.  
  30. 1: The word --> If you REALLY want to make words that extend between
  31. screens, you can do so using -->.  It certainly isn't "darned near
  32. impossible", because --> makes it quite possible.
  33.  
  34. 2: FORTH may be "restrictive" in the area of code formatting, and may
  35. attempt to "enforce discipline" in this area.  On the other hand, it
  36. contains dictionary threading features that allow extensive use of
  37. what often amount to "hacks."
  38.  
  39. On the one hand, FORTH tries to "force" you to FORMAT the code in
  40. restrictive ways, but you can do an end-run by making up funny
  41. syntaxes and CREATE DOES> words.
  42.  
  43. 3: Pascal and Modula-2 are designed to "keep programmers from breaking
  44. the rules" by having an almost Orwellian set of type checking
  45. mechanisms, which cannot be turned off.
  46.  
  47. People that like Forth tend not to like THAT form of "programmer
  48. control."  However, the BLOCK purists are proposing another different
  49. form of "programmer control."
  50.  
  51. A competent Forth programmer SHOULD write the code using relatively
  52. small fragments.  Whether these fragments come in the form of BLOCKs,
  53. or as "stream" files should be of little relevance.  If you're
  54. competent, the form of the file format shouldn't matter.
  55.  
  56. A Forth programmer can write unreadable code using blocks just as
  57. easily as (s)he could with files.  --> is quite enough to give great
  58. complications.  In addition, BLOCKs can be looked at as a form of
  59. "goto" statement, which can be abused just as much as goto statements
  60. ever could.
  61.  
  62. Sometimes "goto" is useful too, of course.  I'm surprised that nobody
  63. has brought up the classical argument that "BLOCKs can be used to
  64. implement virtual memory."  They most certainly ARE useful for that
  65. purpose.  There may be some "alligators" in there if you're working
  66. with pieces of data that might overlap blocks.  That goes with the
  67. territory.
  68.  
  69. BLOCKS represent random access to data; files generally represent
  70. sequential access to data.  Both are useful tools.  For organizing
  71. source code, files are usually easier.
  72.  
  73. Has anybody tried using RCS in conjunction with a BLOCK based system?
  74. I think not.  It assumes that there are carriage returns between
  75. lines.  I suppose that one could write a utility to break blocks up
  76. into lines, and back again as necessary.  It would be an ugly way to
  77. do things, though.  It's easy with a file based system.
  78.  
  79. I would suggest that in a modern FORTH system, it should be POSSIBLE
  80. to use both.  It's pretty easy to load code from either BLOCK or
  81. stream.
  82.  
  83. In the case of an embedded controller, there may not BE anything
  84. connected in the end, aside from an RS-232 connection.  In this case,
  85. "streams" win out, since there is nothing that even resembles a BLOCK.
  86. I think that EForth works this way.
  87.  
  88. If there's a block of RAM kicking around, it may be turned into a set
  89. of BLOCKs.
  90.  
  91. But for a workstation based system, it makes little sense to restrict
  92. it to BLOCKs.  
  93.  
  94. I'd argue that I prefer to use "streams" for source code.  I would NOT
  95. argue that it is USELESS to have a BLOCK system as well.  I'd prefer
  96. to have the choice, because there are cases where each may be
  97. necessary.
  98.  
  99. -- 
  100. Christopher Browne                |     PGP 2.0 key available
  101. cbbrowne@csi.uottawa.ca           |======================================
  102. University of Ottawa              | Genius may have its limitations, but
  103. Master of System Science Program  | stupidity is not thus handicapped.
  104.