Educating FORTRAN programmers to use C

Walter Bright bright at Data-IO.COM
Tue Jan 9 06:53:33 AEST 1990


In article <1016 at sdrc.UUCP> gcglan at sdrc.UUCP (frank glandorf) writes:
<Has anyone had any interesting experiences educating FORTRAN
<programmers to use C?

Yeah. The result is amusing, the first programs they write looked like
Fortran! All integer variables were i,j,k,l,m,n, lots of gotos to L109,
L110, etc!.

I've also seen Pascal converts to C. Their code looks a lot like Pascal.
A typical thing is to not believe that the short circuit operators &&
and || are reliable, the Pascal state variable uglies appear everywhere
(to avoid using 'break' from a loop).

It's fun looking at other people's C code and guessing what language they
migrated from!
As time goes by, these anachronisms fade and the code looks more and more
like C.

I came to C with a background in Pascal, asm, and mostly Fortran. My first
major C program looked like Fortran. It did all static data allocation,
not a single pointer, tons of global data, etc! (I still use i,j for int
variables, and Lnnn for goto labels!)

<Another result was the extensive use of macros to disguise the
<use of the -> operator.

Sounds like you need C++.



More information about the Comp.lang.c mailing list