NOT Educating FORTRAN programmers to use C

abdul shammaa spabdul at sdrc.UUCP
Sat Jan 13 15:46:58 AEST 1990


In article <5303 at tekgen.BV.TEK.COM>, kurtk at tekcae.CAX.TEK.COM (Kurt Krueger)
writes:

> Most of your definition of 'crap' in Fortran is the style of the programmer.
> I can generate 4x that type of 'crap' in C.

Well, anyone can generate bad code regardless of the language.  However, a
good programmer can make C far more readable than FORTRAN 4.  The fact that
variable and function names in C are not limited to six character long makes
life a lot easier.  And I don't mean that you abuse the fact that C does
not_place_a_restriction_on_variable_lengths  :-) That kind of variable
name would be too much.

> computer programming was upon us before C became popular, it was entirely an
> ART when Fortran came about.  Thus 'crap' was acceptable in Fortran 4, but not
> so in C.  It is not acceptable in f77 (but that doesn't stop anyone).
> 
> It might enlighten you to read a book by Kernighan (THE K in K&R) and Plauger
> called "The Elements of Programming Style".  It's about (GASP!) Fortran.
> Shows the difference between good Fortran and 'crap'. Too late for the ignorant
> type who used 200+ GOTO's.  If the dyed-in-the-wool Fortran programmers in
> you organization haven't read it, they should.
> 
> I'm  still a firm believer that if you want performance on multiple
> platforms, Fortran (but f77 PLEASE!) is still the way to go.  Fortran
> does some things real nice (try passing a variable dimensioned 3-d
> array into a C function - UGH!, or dealing with COMPLEX variables),

How about the performance and productivity of the programmer?  Should that
not be taken into account, too?
I am not sure what the difference is in passing a variable dimensioned
3-d array between C or FORTRAN.  On the other hand, COMPLEX variables
are built into FORTRAN, which is nice...But that's why you have structures
in C.  You can build your own little utility that may have any complex
variable operations your heart desires.  Besides, how often, for example,
do you really use complex variables VS. the need to allocate memory on the
fly? ;-)
I agree that you sacrifice some things when you use C rather than FORTRAN,
but it's my opinion that you gain a lot more.  C can be very powerful in good
hands but dangerous in not so good of hands.  So, make sure that you don't
hire those bad hands in your organization! :-)

> and some things are ugly (f77 does not support dynamic memory...

I am sorry, let's clear up somthing: you're talking about f77 but I'm
talking about FORTRAN 4.

> One last question  - are you sure that you don't fear Fortran and don't want
> to change?
> 
> (My credentials - 15 years Fortran on CDC equipment (excellent Fortran, no C)
>  3 years C on Unix.  Language of choice - DEPENDS ON THE APPLICATION.  When
>  it's a push, I'll use C.  If it's bsd Unix, I do my best to avoid f77)

Ok, here is the story...
The first computer language I learned was FORTRAN, and I loved it.  As an
engineer, I did 3 years of FORTRAN programming (but it was f77), not to
mention all programming in undergraduate and graduate school.
There came a time when my previous employer imposed C on us.  I did not
like it a the begining (I guess it was fear), but I soon saw the light.
Then, we moved from C to an Object Oriented Language (in house).  OOL was even
much better than C!  If I write my own application, I'll write it in a hybrid
object oriented programming language even if looks nothing like C.
So you see, one does not fear what he already knows, but he/she fears the
unknow.  If some new language comes up tomorrow that claims to be better
than OOP, I'm (objectively) eager to check it out.  Are you?  If you're
not, may be that's why we're having this dual.

-----------------------------------------------------------------------------
Disclaimer: The above does not necessarliy represent the views or opinoins
	    of my organization.

					uunet!sdrc!spabdul



More information about the Comp.lang.c mailing list