Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!hc!beta!a!jlg From: jlg@a.UUCP (Jim Giles) Newsgroups: comp.lang.fortran Subject: Re: FORTRAN horrors Message-ID: <549@a.UUCP> Date: 31 Mar 88 00:20:50 GMT References: <497@amethyst.UUCP> Distribution: na Organization: Los Alamos Natl Lab, Los Alamos, N.M. Lines: 43 Summary: Not there In article <497@amethyst.UUCP>, chris@spock (Chris Ott) writes: > > > When was the last time you programmed in C? If I remember correctly, C > does have dynamic array dimensioning. I can't say for sure because I don't > often use arrays with more than one subscript. Not only that, but C, with > its alloc() and free() routine can dynamically allocate memory while the > program is running, something I've never seen Fortran do. 1) C has a VERY bad syntax for multidimensioned arrays. Most systems programmers don't need them, so they don't care. Few scientific programs go WITHOUT at least one multidimensional array. Fortran looks much better in this regard (literally LOOKS better). 2) C doesn't really have arrays at all - they get turned into pointers immediately. This failing was the subject of an article by no less than P. J. Plauger a short time back (Programming Faux Pas, _Computer Language_, April 1987). 3) Most Fortran environments have a way of dynamically allocating memory. Some use pointers, others have a language extension, others simply use out-of-bounds array subscripting. Fortran 8x requires this capability. > > Not intrinsically, but in practice, C is a lot more portable than Fortran. > I've had no trouble transporting C programs between UNIX machines and very > little trouble transporting them between non-UNIX machines. [...] I've never had any trouble transporting Fortran either. I just don't use any features that I know don't port well, and porting is no problem. C is the same - most C programmers quickly learn which things don't port well and simply don't use them! Don't chalk something up as a feature of the language when it's really due to familiarity of the programmer. > Oh, I almost forgot. Please redirect any responses to this article to > comp.lang.fortran. The comp.arch people are beginning to get upset, for good > reason. > No!! don't forward to comp.lang.fortran!! Forward to comp.lang.religion if you must :-). comp.lang.fortran is NOT the place to discuss the deficiencies of C as a scientific language (or its advantages either). J. Giles Los Alamos