Path: utzoo!attcan!uunet!convex!convex1.convex.com!rosenkra From: rosenkra@convex1.convex.com (William Rosencranz) Newsgroups: comp.lang.fortran Subject: Re: What is FORTRAN for? Message-ID: <104559@convex.convex.com> Date: 2 Aug 90 07:04:21 GMT References: <9007312124.AA14917@euler.Berkeley.EDU> Sender: usenet@convex.com Organization: Convex Computer Corporation; Richardson, TX Lines: 77 In article <9007312124.AA14917@euler.Berkeley.EDU> ndeng@EULER.BERKELEY.EDU writes: >I wrote the program in FORTRAN. I didn't have to change a SINGLE line to let >the program run from PC through Cray. I wonder if any other languages can >enjoy such a portability. good for you! that means you are a good programmer. is sez nothing about the language, however. i regularly do this with C (atari st, ibm pc, sun, dec 3100, sgi, alliant, convex, cray x/y/2, etc). it is NOT the language. it is the PROGRAMER. in fact, having to port codes from platform to platform for a living, i find C (for me) easier to port (generally) than fortran. if i had f77 on my atari st, and an emacs with fortran mode on the st, i'd probably use more fortran for code i also use at home. i find that there are more places to abuse the language (abuse to me means writing non- portable code :-) in fortran than C. with C, the problem is in library compatibility more so than the language itself. things like enum in C were not part of K&R so i don't use them. but hey, that's me. your results may vary. C was designed to be portable. fortran was (originally) designed to program in something other than assembly language. remember, that was a LONG time ago. C was developed to make unix portable. if your platform is unix, you really can't do much systems programing in fortran, easily, at least. C is the real choice, rightly so. if you only write applications which crunch, then fortran is, of course, an excellent choice. i don't use pascal since it is no where as "universal" as C, certainly not in supercomputer circles. >I once heard people said that there are only 20% of code in a program are >really useful in computation and they need 80% of effort. Other 80% of code >are really only for human interface (I/O, memory, graphics,etc.) or "cosmetic" >and they may need only 20% of effort. IMHO, FORTRAN is the language for the >20% of code. no problem here... the 80% of the code is really what sets apart good commercial code from just a hack. that 80% makes or breaks an application (its commercial success), especially on smaller systems (pc's [generic]). if your interface doesn't turn people on, no matter how well crafted the "guts" are, you die. unfortunately, those are the facts. i have a code on the market now which includes things like FFTs. it is 60,000 lines of C of which about 50,000 lines deals with the user interface. it could not have been written in fortran, at least not in "only" 60,000 lines. try writing an X11 application all in fortran sometime. fortran is great for simple arrays, but it is terrible for more complicated data structures where it is desirable to group dissimilar data types together. you can't have an array in fortran with both integers, floats, characters, etc. you can use a struct in C, however, to do this. this is a religious issue. it really should not be. use the best tool for the job. use the best tool for you. patently dismissing a language as bad for whatever reason is just not very wise, IMHO, especially a widely used language (like C). there are well over 10 million pc's on the planet and most of the code running on them was written in C (or assembler). there are only (arguably) a few thousand supercomputers with most of the code there in fortran. which would you call more widely used? actually, you could argue that cobal (yeech!) is much more widely used than fortran since much of the financial transactions on the planet are done with code written in it. is cobal a poor language? hardly. is fortran better? no, not for doing the job for which cobal was meant. what do you think about Ada? the DoD is just about mandating it for embedded systems. it is more like pascal and C++ than fortran. the reason ada was developed was not to do matrix multiplies, but to be able to develop 1,000,000+ line applications and be able to maintain them. -bill rosenkra%c1yankee@convex.com (my opinions, not my employer's...) Bill Rosenkranz |UUCP: {uunet,texsun}!convex!c1yankee!rosenkra Convex Computer Corp. |ARPA: rosenkra%c1yankee@convex.com