forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Rumors about upcoming Fortran version, and could Fortran ever be object oriented?

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
Anonymous
Guest





PostPosted: Thu Nov 10, 2005 1:21 am    Post subject: Rumors about upcoming Fortran version, and could Fortran eve Reply with quote

Are these rumors true?

1.) I have often heard that common blocks are bad structure,
to be avoided by passing ALL arguments as parameters
even if several sboutine calls deep. I have good stylistic habits,
and never experienced difficulties with major common-block usage.
Am I a programming Neanderthal who is sorely amiss? What is the
anti-common-block argument?

2.) And what is this "intent" descriptor for a variable in a subroutine?
Why is it necessary. I imported a lot of my f77 codes to f95 with
minimal changes, never used "intent", and things worked fine.

3.) Could Fortran ever be objectoriented (as opposed to procedural),
or is that an oximoron? Fortran has stayed alive by in-morphing
capabilities (like GUI) from other languages. Why not object oriented
capability?

Best wishes and many thanks from a curiou soul,
Ludwig
Back to top
weaverwb



Joined: 04 Aug 2005
Posts: 37
Location: Monterey

PostPosted: Thu Nov 10, 2005 4:38 am    Post subject: Rumors about upcoming Fortran version, and could Fortran eve Reply with quote

Ludwig:

Being an ancient FORTRAN coder myself, you've touched on a couple of my hobbyhorses. Personally, I'm always offended by [big]mandatory[/big] features in a language that are present only to protect the programmer from himself. Many of these constructs are foisted upon us by those I consider not real users of the language but academic weenies. Thankfully, the FORTRAN committee has seen fit to maintain traditional capabilities.

For me, the list includes intrinsic none (What a silly tedium to constantly be declaring i,j,k,ifred, etc., as integers); the hated goto (there are lots of very complicated nests where knowing not to enter them is beyond mortal's grasp and various exit statements are just gotos thinly masked); and, as near as I can tell, the intent statement. If you're a bad coder, use'm but don't make them madatory for those of us who can keep such things straight.

Common blocks, now that include statements are quite standard so as not to worry about typos, are particularly useful. I write a lot of scientific simulation and real-time control code and I typically maintain the state of the system in common and have routines operate on it. Basically phenomena operating on the state of the system.

The obsession with object-oriented constructs is yet another way to try to enforce style. I was on one project where the suffix '-object' was attached to everything, including object-objects. In the end, hundreds of pages were written about the objects but the problem was not solved and a couple of us had to bail out the 18-month project in a couple weeks at the end.

To my mind, the programmer's toolbox should be as flexible and full of different tools as possible. It is sad to see time-critical applications written in java; embedded software written in C++ (rather than ada); short, one-shot programs not written in a quick and dirty language like basic; number crunching code written in C ( or even java!) instead of Fortran; and difficult projects attempted in top-down style where there is no real hope in fully understanding the problem before starting.

Well, this is way too long for this forum; the underlying problem that I've witnessed over the past 40 years of doing science with software is that programmers are devoted to current fads rather than solving the problem with the best tool. To bring it back to this forum, I chose ftn95 because Clearwin+ had the features I needed (yes, I tried winteracter) but you'll see from my thread below, that I may go to a different fortran compiler for a different problem.



Bruce Weaver
_________________
Bruce+Weaver
Back to top
View user's profile Send private message
Anonymous
Guest





PostPosted: Thu Nov 10, 2005 8:31 pm    Post subject: Rumors about upcoming Fortran version, and could Fortran eve Reply with quote

Dear Bruce,

Greetings again and thank you
for your insightful comments.

Best regards,
Ludwig
Back to top
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Fri Nov 11, 2005 1:33 am    Post subject: Rumors about upcoming Fortran version, and could Fortran eve Reply with quote

Ludwig

2) All Fortran arguments are passed by reference. Since there is no "pass by value", INTENT provides a measure of alternative protection within a subprogram. It enables the compiler to check that you have used a variable in the way intended.

3) Fortran 90 MODULEs provide a movement towards object orientation. Fortran 2003 goes further with TYPE member functions.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Sat Nov 19, 2005 10:30 am    Post subject: Rumors about upcoming Fortran version, and could Fortran eve Reply with quote

Bruce,

I enjoyed your message. comp.lang.fortran has a huge correspondence on the proposition that "IMPLICIT NONE" should be the language default, and there are some right fascists there.

I've programmed Fortran for 35 years, and have NEVER had a problem that IMPLICIT NONE would have solved (it generates more than it fixes). In addition, I like GOTO - in the right place - (as I like to know where I'm going before I set out!) - and prefer fixed format to free format - and (horror of horrors) I usually program code in capitals with short variable names! MODULE seems to me to create more scoping problems with variable names than it solves: named COMMON blocks are actually more helpful.

I have yet to see a single feature introduced in 90 or 95 that I have any use for, and frankly think that most of those new standards simply duplicate facilities already in existence. In my view it is lunatic to have a language which contains no facilities for graphics, and thus no facilities for coding a user interface beyond the "glass teletype" or "fake card deck and lineprinter" approaches. If the Committee had grasped that nettle, Fortran might be regarded as less of a dead language.

Eddie B.



Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group