Results 1 to 10 of 10

Thread: C/C++ v. Fortran???

  1. #1

    Thread Starter
    Lively Member HeVa's Avatar
    Join Date
    Jul 2001
    Location
    DC
    Posts
    115

    C/C++ v. Fortran???

    Hi!

    I work with a bunch of Engineers who still program all
    of their apps in Fortran, because of its computational
    efficiency. One particularly haughty engineer claims
    that Fortran can run circles around C/C++, with respect
    to computational algorithms (and claims to have
    confirmed this with testing). Because game
    programmers use C/C++ and need very fast/robust
    geometry/kinematics algorithms to execute their programs
    in real time, I'm kind of suspicious of his claims. What
    do you think? Does this sound right to you? Do you
    know of any supporting evidence?
    H e*V a

  2. #2
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    FORTRAN supports really extended-precision datatypes like REAL*16 Operations on these datatypes are hard and slower to do in C because there is no library for them.

    For the datatypes the two share in common, there is no difference. Most FORTRAN programmers write crappy C even if they think they know everything about programming. They use
    global variables, for example. These can't be optimized by C, but are in FORTRAN.

    If you allow ASM, then C wins hands down. You can't code inline asm in FORTRAN, like many flavors of C and C++ support. Of course you could code separate modules in asm, then link them in later, but they would not be in-lined automatically.

    AFAIK, The only other language (that has any major distribution) that can be made very fast using inline asm, is PowerBasic, but it runs only in DOS & Windows.

    FORTRAN, C, C++, & BASIC will be around for long time because they are the best for certain kinds of development.

  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Surely you could just write a library in C to do that?
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  4. #4

    Thread Starter
    Lively Member HeVa's Avatar
    Join Date
    Jul 2001
    Location
    DC
    Posts
    115
    Thanks, people, for the responses. Jim, good info -- thanks again! FYI, one of my coworkers has been able to do some pretty heavy-duty 3-D graphics in Fortran with OpenGL. Pretty Impressive!!!
    H e*V a

  5. #5
    Fanatic Member
    Join Date
    Jan 2003
    Posts
    1,004
    Fortran programmers don't write bad C. Its different than what you are used to.

    In game development, people use globals to cut times in passing parameters.

    According to that line of logic, you could say that C programmers cannot write C++ programs because the programs they write are not following the OOP paradigm.

    Its different, but I would not say that it is "crappy."

  6. #6
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    DW - they pay me to optimize C code from FORTRAN & COBOL programmers. All of it works, the other programmers just don't get what needs to be done in C because they 'think' in FORTRAN or COBOL.

    And FWIW, C++ is a radically different mindset from C.

    And finally: THERE IS NO 'BETTER' PROGRAMMING LANGUAGE.
    FORTRAN people are notorious as are C people for claiming this is better than that. What the languages are meant to do is not mutually inclusive. FORTRAN OS primitive programming would be major effort, C engineering programming ditto.

    My point is that usually a lot of the claims are bogus.
    If you ever saw FORTRAN 66 or WATFOR you'd see how BASIC-like & C-like FORTRAN has become since 1960.

  7. #7
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Originally posted by Darkwraith
    Fortran programmers don't write bad C. Its different than what you are used to.

    In game development, people use globals to cut times in passing parameters.

    According to that line of logic, you could say that C programmers cannot write C++ programs because the programs they write are not following the OOP paradigm.

    Its different, but I would not say that it is "crappy."
    C++ is not an OOP language. It is *capable* of it, and has a lot of features to support it, along with OOP being the original reason for creating it. However, that is not all it can do (i.e. generic programming, or just good ol' procedural, albeit with a far better type system).
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  8. #8
    Fanatic Member
    Join Date
    Jan 2003
    Posts
    1,004
    The original criteria that C++ was created were to (1) be backward compatible with C and (2) support classes and other OO aspects. Because of this, C++ does have the capability to become object-oriented, so I group it with this paradigm. Also, the other languages that I could draw from for this paradigm other than Java would be Smalltalk and Ada 95. This does not compose a very large gathering of followers excluding Java(maybe Ada 95 if you are in the military but) Java is verrrry similar to C++ and is totally OO, but I am trying to stick with our category C / C++.

    Now when you were referring to FORTRAN, I was thinking FORTRAN 90 and not 66 which have features in common with C, so sorry about the confusion.

    Finally, I did not say that one language is better than the other. I just said that they were different. Every PL that I encountered (QBASIC, PASCAL C++, VB, TI-BASIC, LISP, Java, assembler, ...) are all capable of completing the same problem (in the majority of cases,) however, they all approach it at different angles. It's the right tool for the right job.

  9. #9
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Of course. I wouldn't use C++ for a web product unless it *really* needed the speed (give me PHP or Perl any day).
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  10. #10
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    mod_perl or PHP, CGI perl sucks...
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width