User talk:Dinosaur

From Rosetta Code
Revision as of 03:17, 3 November 2015 by Dinosaur (talk | contribs) (→‎Fortran)

Fortran

Dear Dinosaur, you contribute a lot to Fortran code on Rosetta and that is great, and I appreciate it because your wide and deep experience in Fortran is indisputable and your contribution currently is a significant part of progress for solved tasks in Fortran! The only remark: I noticed that you are using often old F77 standard, so in order not to confuse the new and naïve audience about the possibilities of modern Fortran, would you be so kind to specify always the standard you are currently using in the code? Thank you! Zmi007 (talk)

Ah, I had of course regarded it as obvious what flavours of furrytran were in the code. More modern compilers continue to accept F77 as well as make available new features and even, new conveniences, such as the PARAMETER statement, generic function names and interesting functions/statement features such as ALL, ANY, COUNT, and, above all, array assignment syntax. For larger programmes, the MODULE protocol is a great relief compared to massive COMMON statements - at the Culham Science Centre I encountered a 80,000 line prog. that had about a hundred subroutines, all of which included a file containing a COMMON statement of twenty lines or so, and deep within that appeared variables I,J. No wonder my debugging stuff behaved as oddly as the programme. Fortunately, I had my own furrytran editor (written in furrytran) that distinguished between source text, text literal content and commentary text, and, knew about continuation lines. And, by default did not perform literal text matching so an assault on "I" did not damage "IF" and so forth. On the other hand, I dislike the flabbily verbose drivel associated with "KIND" in the latter furrytrans, especially as they increase the obscurity. REAL*8 seems both succint and clear enough to me. And the generality is specious, as decimal computers were once common but these days, everyone seems to regard intel as universal.
I tend to stick to F77 style (aside from these tasty new features) because I have had some odd experiences with latter-day compilers, such as spaces becoming important (so MODULE BIG BAG lead to odd and troublesome behaviour that vanished with MODULE BIGBAG) and a startling encounter with tabs and the old-style 72-character limit. It appeared that tabs were replaced by spaces, and suddenly, source following such tabs was pushed beyond character 72 in the expanded interpretation. I usually make some remark about "older" fortrans, but I test the progs. with a F95 (as I recall, I'm in a cybercafe, not near the compiler) style compiler. I shall endeavour to be more explicit...
For instance (having just now looked again at "Compare a list of strings" I see you missed the remark "Later Fortran offers the special function ALL...", and the use of this sort of function is available only with F90 and later. Thus, the example code will not compile with F77, only with F90 and later. And, I declare and use an array of character variables; this is not a "hack" but an ordinary array of thingies, each thingy being almost a string, lacking only a current length.