|
-
Mar 3rd, 2003, 05:39 PM
#1
Thread Starter
Lively Member
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?
-
Mar 3rd, 2003, 06:17 PM
#2
Frenzied Member
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.
-
Mar 3rd, 2003, 07:14 PM
#3
Monday Morning Lunatic
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
-
Mar 5th, 2003, 09:30 AM
#4
Thread Starter
Lively Member
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!!!
-
Mar 7th, 2003, 11:40 AM
#5
Fanatic Member
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."
-
Mar 7th, 2003, 12:20 PM
#6
Frenzied Member
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.
-
Mar 7th, 2003, 04:54 PM
#7
Monday Morning Lunatic
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
-
Mar 9th, 2003, 12:24 PM
#8
Fanatic Member
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.
-
Mar 9th, 2003, 01:07 PM
#9
Monday Morning Lunatic
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
-
Mar 9th, 2003, 01:26 PM
#10
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|