Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!ames!skipper!elxsi!maine From: maine@elxsi.dfrf.nasa.gov (Richard Maine) Newsgroups: comp.lang.fortran Subject: Re: Is this kosher? Message-ID: Date: 4 Feb 91 17:13:38 GMT References: <91030.132436KENCB@SLACVM.SLAC.STANFORD.EDU> <9102041020.AA00951@LL.MIT.EDU> Sender: news@skipper.dfrf.nasa.gov Organization: NASA Dryden, Edwards, Cal. Lines: 50 In-reply-to: preston@LL.MIT.EDU's message of 4 Feb 91 15:20:45 GMT On 4 Feb 91 15:20:45 GMT, preston@LL.MIT.EDU (Steven Preston) said: Steven> In article <91030.132436KENCB@SLACVM.SLAC.STANFORD.EDU> KENCB@SLACVM.SLAC.STANFORD.EDU writes: > However, MUCH to my SURPRISE, John's test program fragment compiled just > FINE under VAX Fortran! Sheez! Steven> This is unfair to VAX Fortran. If you would do a "help fortran" you Steven> might notice that there is are /standard and /f77 switches. The Steven> /standard switch, along with the /warnings switch, will produce Steven> warning messages when certain vax extensions to the standard. Steven> ... Steven> This seems to be very reasonable, to provide an extension (which is Steven> legal under the standard) and a way to warn when it is used. Agreed. However, I'd quarrel with the system's choice of default switches. This is a fairly generic issue, not just a Vax complaint, or I wouldn't have bothered to post. I actually don't use Vaxen much at the moment, but I've raised simillar questions with other vendors. Although extensions are fine in general, I prefer to see at least the "unsafe" extensions disabled by default. The term "unsafe" is admitedly vague here. I think of an unsafe extension as one that might provide a cover for programming errors to pass undetected. For a trivial (and common) example, allowing string = 'a' where "string" is (implicitly) real counts as an unsafe extension in my book. The odds are just to strong that the programmer forgot to declare string as character instead of intending to use the extension. On the other hand, allowing mixed case or long variable names seems innocuous; it is unlikely to misinterpret the programmer's intent. (Unless the programmer comes from a C background and thinks it reasonable that N and n be the names of 2 different varables). The problem with allowing extensions (particularly "unsafe" ones) by default is that this means the most inexperienced programmers will invariably be compiling with the extensions enabled. These are the programmers most in need of the help that /standard or /warning switches or their equivalents provide. (I don't mean for a second to imply that experienced programmers can't also use the help, just that the inexperienced ones need it more). The programmer wanting to use special extensions should at least be aware that they are extensions and it seems reasonable to ask him or her to set the switch enabling them. I have a simillar position about defaults optimization and debug switches. I think default switch settings should be conservative to help catch problems and that people trying to tune codes for maximum performance should be expected to be more aware of switch options than people that are occasional programmers just trying to get something to work.