home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / sci / engr / mech / 499 < prev    next >
Encoding:
Text File  |  1992-11-06  |  2.7 KB  |  59 lines

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