home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: sci.engr.mech
- Path: sparky!uunet!think.com!ames!purdue!yuma!longs.LANCE.ColoState.Edu!kk881595
- From: kk881595@longs.LANCE.ColoState.Edu (kevin knappmiller)
- Subject: Re: Any experience with programming in C++ related to Mech.Eng.
- Sender: news@yuma.ACNS.ColoState.EDU (News Account)
- Message-ID: <Nov05.202840.71890@yuma.ACNS.ColoState.EDU>
- Date: Thu, 05 Nov 1992 20:28:40 GMT
- Reply-To: kk881595@longs.LANCE.ColoState.Edu
- References: <1992Nov3.171949.4801@magnus.acs.ohio-state.edu>
- Nntp-Posting-Host: princeton.lance.colostate.edu
- Organization: Colorado State U. Engineering College
- Lines: 45
-
- There are quite a few issues that one needs to address when
- deciding to program in C or C++ versus Fortran. Here are a few:
-
- (1) If you are really going to "program" yourself, as opposed to
- just assembling code fragments, the quality of the particular
- development environment which you can afford for your
- hardware platform is very important. I would assert that
- this is more important for most "scientific" programming
- than a particular language. If you are going to write
- your own code it will probably be on the order of 1000 lines.
- I have found that for problems of this length the use of the
- "object based concepts in C++" often only make matters more
- difficult, especially if (2) is important.
-
- (2) What is the execution speed of the general algorithms
- you are going to use in each of the languages on the targeted
- platforms? For example on a Cray YMP it is much easier to
- get Fortran to run fast than it is to get C to run fast. This
- may be important towards the overall cost of your work. It may
- not be. As a note I found that on every platform I used, ie
- Vax, DecStation, PC, Cray YMP, I was always successful in getting
- C code to run faster than the equivalent Fortran, but, especially
- on the Cray, it took more work.
-
- (3) What tools are available to you that apply to your programming?
- For example object libraries in C++, or high level scientific or math
- libraries in Fortran.
-
- (4) How much code is there that you can reuse for your project?
- Most projects that one can undertake have been *almost* done
- already, even most Ph.D. work. The time spent finding a code that
- you can modify rather than recreate is usually worth it. Because
- of the history of scientific programming most of that code is
- written in Fortran.
-
-
- The existence of such a code (4) for your project,
- in my opinion, is probably the only reason to use Fortran if you
- feel comfortable programming in C++. I have found that points
- (1), (2), and (3) usually fall strongly in favor of C and/or C++.
- I must say that I do most of my programming in Fortran precisely
- because of point (4), but I also cuss alot.
-
- Kevin
- kk881595@longs.lance.colostate.edu
-