Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!maverick.ksu.ksu.edu!harris.cis.ksu.edu!mac From: mac@harris.cis.ksu.edu (Myron A. Calhoun) Newsgroups: comp.lang.fortran Subject: Re: Fortran 77 Style Guide (long, REPOST) Summary: piddling Message-ID: <1990Sep11.191119.22682@maverick.ksu.ksu.edu> Date: 11 Sep 90 19:11:19 GMT Expires: 25 September 1990 References: <1794@ccadfa.adfa.oz.au> <1990Sep10.141639.970@maverick.ksu.ksu.edu> <90254.120334FC138001@ysub.ysu.edu> Sender: news@maverick.ksu.ksu.edu (The News Guru) Distribution: na Organization: Kansas State University, Dept. of Computing and Information Sciences Lines: 36 In article <90254.120334FC138001@ysub.ysu.edu> Phil Munro I think duplicated FORMAT statements mean added memory allocations >when the program is compiled. Is this not right? > It seems just as easy to use "any reasonable editor" to find every >use of a FORMAT as to duplicate them and waste memory. On the other >hand, except for the machine-code memory problem, it is an appealing >idea to put WRITEs and FORMATs together. --Phil OK, let me make some unreasonable assumptions: Assume some program has 50 different FORMAT statements which appear an average of 3 times EACH (is this UNreasonable enough?) The ** average ** FORMAT statement probably fits in well under 100 bytes. 50 * (3 - 1) * 100 = 10,000 extra bytes. On a 64K machine (does anyone still use one of these), and extra 10K might be rather important, but on modern computers with modern-sized memories, 10K seems rather piddling to me. Perhaps a stronger argument for "one I/O statement, one FORMAT" is the modern idea that code modules should be readable in one forward top-to- bottom pass. Re-used FORMAT statements require flipping back and forth through the code and thus violate the "one pass top-to-bottom" convention. But duplicating the (almost always a) few FORMAT statements follows this convention. Besides, if you have a "zillion" FORMAT statements that are re-useable, why not put them in a separate I/O routine and just have one copy of the I/O statements, too! --Myron. -- # Myron A. Calhoun, Ph.D. E.E.; Associate Professor (913) 539-4448 home # INTERNET: mac@harris.cis.ksu.edu (129.130.10.2) 532-6350 work # UUCP: ...{rutgers, texbell}!ksuvax1!harry!mac 532-7004 fax # AT&T Mail: attmail!ksuvax1!mac