home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.edu:1361 comp.lang.fortran:3199
- Newsgroups: comp.edu,comp.lang.fortran
- Path: sparky!uunet!stanford.edu!leland.Stanford.EDU!gooch
- From: gooch@leland.Stanford.EDU (Carl Gooch)
- Subject: Re: Small Language Wanted
- Message-ID: <1992Aug26.195551.11962@leland.Stanford.EDU>
- Sender: news@leland.Stanford.EDU (Mr News)
- Organization: DSG, Stanford University, CA 94305, USA
- References: <DAVIS.92Aug23010605@pacific.mps.ohio-state.edu> <1992Aug25.034553.2990@linus.mitre.org> <1992Aug25.154501.8654@colorado.edu>
- Date: Wed, 26 Aug 92 19:55:51 GMT
- Lines: 56
-
- In article <1992Aug25.154501.8654@colorado.edu> ejh@khonshu.colorado.edu (Edward J. Hartnett) writes:
-
- >I don't mean to sound like I'm running down scientists at all. I'm
- >just saying that the problems lie not in our stars, but in ourselves.
- >You can have good programs in any programming language, and bad
- >programs ditto. It's more a function of the programmer's outlook and
- >training than the programming language (IMHO).
-
- I'd agree with that. If you're writing a piece of code that you know
- will be 5000+ lines and that you're going to have to maintain and
- improve for a long time to come, you write it reasonably well in
- self-defense. I'll grant that the definition of "reasonably well"
- varies between individuals, but I doubt there are many large new
- Fortran codes being written with flocks of arithmetic if's and
- computed goto's.
-
- >I never use common blocks myself, ditto global variables (are their
- >global variables other than in common blocks?). Subroutine arguments
- >are always passed by reference, never value (how do you pass by
- >value?). User defined data types (i.e. structures) are available in
- >many implementations of FORTRAN (e.g. Sun), if you don't insist on
- >standard FORTRAN 77, ditto for loop constructs. I have to say right
- >here that I am talking about FORTRAN with extensions. I would never
- >like to write in strict standard FORTRAN. But I think that commercial
- >applications are rarely written in FORTRAN, and too many FORTRAN
- >programmers don't use the language extensions, althought there is
- >little chance they will ever have to port their code, and a good
- >chance that if they do, the other machine will support the same or
- >similar extensions.
-
- It's true that common blocks don't help code readibility, but there
- are cases where not using them requires passing a long list of
- parameters several steps up and down a call tree. In those cases, I
- prefer to use common and pass only parameters which are immediately
- relevant. (I also declare common blocks and the variables contained
- in them in include files, so that I never have to worry about my
- declarations of the same common block conflicting.)
-
- Extensions like do-while loops are common enough that I use them
- freely, partly because in an emergency, the changeover to if ... goto
- ... wouldn't be very painful. Structures I tend to avoid, in part
- because that's a less common extension and in part because the changes
- to unsnarl it would, generally, be rather large. If I were writing
- for a single platform, I'd be a lot less picky about extensions.
-
- Your mileage, of course, may vary.
-
- Carl
-
-
-
- --
- ------------------------------------------------------------------------------
- Carl Gooch | Why am I inside at a keyboard when
- gooch@leland.stanford.edu | I could be outside riding bike?
- ------------------------------------------------------------------------------
-